Filtering::step()   A
last analyzed

Complexity

Conditions 2
Paths 2

Size

Total Lines 10
Code Lines 5

Duplication

Lines 10
Ratio 100 %

Code Coverage

Tests 6
CRAP Score 2

Importance

Changes 3
Bugs 0 Features 0
Metric Value
c 3
b 0
f 0
dl 10
loc 10
ccs 6
cts 6
cp 1
rs 9.4285
cc 2
eloc 5
nc 2
nop 2
crap 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 View Code Duplication
class Filtering implements Reducer
0 ignored issues
show
Duplication introduced by
This class seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
15
{
16
    use Mixin\Stateless;
17
    use Mixin\WithCallback;
18
19 6
    public function step($result, $current)
20
    {
21 6
        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 6
            return $this->next_reducer->step(
23 6
                $result, $current
24 6
            );
25
        }
26
27 6
        return $result;
28
    }
29
30
}
31