IntegerHandler   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 13
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 1
eloc 2
c 1
b 0
f 0
dl 0
loc 13
ccs 2
cts 2
cp 1
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A handle() 0 3 1
1
<?php
2
/**
3
 * handler for PHP serialized integer
4
 */
5
namespace xKerman\Restricted;
6
7
/**
8
 * Handler for PHP serialized integer
9
 */
10
class IntegerHandler implements HandlerInterface
11
{
12
    /**
13
     * parse given `$source` as PHP serialized integer
14
     *
15
     * @param Source      $source parser input
16
     * @param string|null $args   integer value
17
     * @return array
18
     * @throws UnserializeFailedException
19
     */
20 9
    public function handle(Source $source, $args)
21
    {
22 9
        return array(intval($args, 10), $source);
23
    }
24
}
25