ArrayCheckStep   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 14
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 4
lcom 0
cbo 1
dl 0
loc 14
rs 10
c 0
b 0
f 0
ccs 4
cts 4
cp 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A process() 0 8 4
1
<?php
2
3
namespace Port\Steps\Step;
4
5
use Port\Exception\UnexpectedTypeException;
6
use Port\Steps\Step;
7
8
/**
9
 * @author Márk Sági-Kazár <[email protected]>
10
 */
11
class ArrayCheckStep implements Step
12
{
13
    /**
14
     * {@inheritdoc}
15
     */
16 6
    public function process($item, callable $next)
17
    {
18 6
        if (!is_array($item) && !($item instanceof \ArrayAccess && $item instanceof \Traversable)) {
19 1
            throw new UnexpectedTypeException($item, 'array');
20
        }
21
22 5
        return $next($item);
23
    }
24
}
25