Total Complexity | 3 |
Total Lines | 44 |
Duplicated Lines | 0 % |
Coverage | 100% |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
16 | final class A extends Combinator |
||
17 | { |
||
18 | /** |
||
19 | * @var callable |
||
20 | */ |
||
21 | private $f; |
||
22 | |||
23 | /** |
||
24 | * @var mixed |
||
25 | */ |
||
26 | private $x; |
||
27 | |||
28 | /** |
||
29 | * A constructor. |
||
30 | 1 | * |
|
31 | * @psalm-param callable(AType): BType $f |
||
32 | 1 | * @psalm-param BType $x |
|
33 | 1 | * |
|
34 | 1 | * @param callable $f |
|
35 | * @param mixed $x |
||
36 | */ |
||
37 | public function __construct(callable $f, $x) |
||
41 | 1 | } |
|
42 | |||
43 | /** |
||
44 | * @psalm-return BType |
||
45 | */ |
||
46 | public function __invoke() |
||
47 | 1 | { |
|
48 | return ($this->f)($this->x); |
||
49 | } |
||
50 | 1 | ||
51 | 1 | /** |
|
52 | * @param callable $f |
||
53 | * |
||
54 | * @return Closure |
||
55 | */ |
||
56 | public static function on(callable $f): Closure |
||
60 | }; |
||
61 | } |
||
63 |