Issues (50)

src/Stream/Accumulator/AccumulatorInterface.php (2 issues)

Labels
Severity
1
<?php
2
3
namespace Bdf\Collection\Stream\Accumulator;
4
5
use Bdf\Collection\Stream\StreamInterface;
6
7
/**
8
 * Base type for reduce operation accumulator
9
 *
10
 * <code>
11
 * class MultiplyAccumulate implements AccumulatorInterface
12
 * {
13
 *     private $factor;
14
 *
15
 *     public function __construct($factor) { $this->factor = $factor; }
16
 *
17
 *     public function __invoke($carry, $item) { return $this->factor * $carry + $item; }
18
 *
19
 *     public function initial() { return 0; }
20
 * }
21
 * </code>
22
 *
23
 * @template V
24
 * @template R
25
 *
26
 * @see StreamInterface::reduce()
27
 */
28
interface AccumulatorInterface
29
{
30
    /**
31
     * Accumulate $item into $carry and return the new value
32
     * The type of initial value, carry and return value must have the same type
33
     *
34
     * @param R $carry The value of the previous call, or the initial() value
0 ignored issues
show
The type Bdf\Collection\Stream\Accumulator\R was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
35
     * @param V $item The item to accumulate
0 ignored issues
show
The type Bdf\Collection\Stream\Accumulator\V was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
36
     *
37
     * @return R The accumulated value
38
     */
39
    public function __invoke($carry, $item);
40
41
    /**
42
     * The initial accumulator value
43
     * If the input is empty, this value will be the result of the reduce operation
44
     *
45
     * @return V
46
     */
47
    public function initial();
48
}
49