Total Complexity | 2 |
Total Lines | 35 |
Duplicated Lines | 0 % |
Changes | 2 | ||
Bugs | 0 | Features | 2 |
1 | <?php |
||
17 | class The implements Scalar |
||
18 | { |
||
19 | |||
20 | /** |
||
21 | * Ctor. |
||
22 | * |
||
23 | * @param T $subject |
||
24 | * @param Closure(T): mixed $context |
||
25 | */ |
||
26 | public function __construct( |
||
27 | /** |
||
28 | * Element to be put into the context. |
||
29 | * |
||
30 | * @var T |
||
31 | */ |
||
32 | private mixed $subject, |
||
33 | |||
34 | /** |
||
35 | * Context for the element. |
||
36 | * |
||
37 | * @var Closure(T): mixed |
||
38 | */ |
||
39 | private Closure $context |
||
40 | ) { |
||
41 | } |
||
42 | |||
43 | /** |
||
44 | * Applies context to subject and returns subject. |
||
45 | * |
||
46 | * @return T |
||
47 | */ |
||
48 | public function value(): mixed |
||
52 | } |
||
53 | } |
||
54 |