Passed
Push — feature/51 ( ffcada...15fa2a )
by Max
02:30
created

SurveyEnvelope::value()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 1
Metric Value
cc 1
eloc 1
c 1
b 0
f 1
nc 1
nop 0
dl 0
loc 3
rs 10
1
<?php
2
3
namespace MaxGoryunov\SavingIterator\Fakes;
4
5
use Closure;
6
use MaxGoryunov\SavingIterator\Src\Scalar;
7
8
/**
9
 * Envelope for useful classes to get rid of redundant variables.
10
 * @template X
11
 * @template Y
12
 * @implements Scalar<Y>
13
 */
14
abstract class SurveyEnvelope implements Scalar
15
{
16
17
    /**
18
     * Ctor.
19
     * 
20
     * @param X                                $subject
0 ignored issues
show
Bug introduced by
The type MaxGoryunov\SavingIterator\Fakes\X 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...
21
     * @param Closure(X): mixed                $context
22
     * @param Closure(X, Closure(X): mixed): Y $composition
23
     */
24
    public function __construct(
25
        /**
26
         * Element for context.
27
         * 
28
         * @var X
29
         */
30
        private mixed $subject,
31
32
        /**
33
         * Context to be applied to the element.
34
         * 
35
         * @var Closure(X): mixed
36
         */
37
        private Closure $context,
38
39
        /**
40
         * Way of combining element and context.
41
         * 
42
         * @var Closure(X, Closure(X): mixed): Y
43
         */
44
        private Closure $composition
45
    ) {
46
    }
47
48
    /**
49
     * Returns result of applying context to element.
50
     *
51
     * @return Y
0 ignored issues
show
Bug introduced by
The type MaxGoryunov\SavingIterator\Fakes\Y 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...
52
     */
53
    public final function value(): mixed
54
    {
55
        return ($this->composition)($this->subject, $this->context);
56
    }
57
}
58