CallableWalker   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 13
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A walk() 0 3 1
A __construct() 0 3 1
1
<?php
2
declare(strict_types=1);
3
4
namespace ReadModel\Walker;
5
6
class CallableWalker implements ResultWalker
7
{
8
    /** @var callable */
9
    private $callable;
10
11 4
    public function __construct(callable $callable)
12
    {
13 4
        $this->callable = $callable;
14 4
    }
15
16 2
    public function walk(array $result): array
17
    {
18 2
        return call_user_func($this->callable, $result);
19
    }
20
}
21