First   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 15
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 4

Test Coverage

Coverage 100%

Importance

Changes 3
Bugs 0 Features 0
Metric Value
wmc 2
c 3
b 0
f 0
lcom 1
cbo 4
dl 0
loc 15
ccs 4
cts 4
cp 1
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A step() 0 8 2
1
<?php
2
3
/*
4
 * This file is part of the Symfony package.
5
 *
6
 * (c) Arnaud LEMAIRE  <[email protected]>
7
 *
8
 * For the full copyright and license information, please view the LICENSE
9
 * file that was distributed with this source code.
10
 */
11
12
namespace Fp\Reducer;
13
14
class First implements Reducer
15
{
16
    use Mixin\Stateless;
17
    use Mixin\WithCallback;
18
19 3
    public function step($result, $current)
20
    {
21 3
        if ($this->callback->__invoke($current)) {
0 ignored issues
show
Bug introduced by
The method __invoke cannot be called on $this->callback (of type callable).

Methods can only be called on objects. This check looks for methods being called on variables that have been inferred to never be objects.

Loading history...
22 3
            return new Reduced($this->next_reducer->step($result, $current));
23
        }
24
25 3
        return $result;
26
    }
27
28
}
29