Total Complexity | 3 |
Total Lines | 62 |
Duplicated Lines | 0 % |
Coverage | 100% |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
17 | final class Psi extends Combinator |
||
18 | { |
||
19 | /** |
||
20 | * @var callable |
||
21 | */ |
||
22 | private $f; |
||
23 | |||
24 | /** |
||
25 | * @var callable |
||
26 | */ |
||
27 | private $g; |
||
28 | |||
29 | /** |
||
30 | * @var mixed |
||
31 | */ |
||
32 | private $x; |
||
33 | |||
34 | /** |
||
35 | * @var mixed |
||
36 | */ |
||
37 | private $y; |
||
38 | |||
39 | /** |
||
40 | * Psi constructor. |
||
41 | * |
||
42 | 1 | * @psalm-param callable(AType): callable(AType): BType $f |
|
43 | * @psalm-param callable(CType): AType $g |
||
44 | 1 | * @psalm-param CType $x |
|
45 | 1 | * @psalm-param CType $y |
|
46 | 1 | * |
|
47 | 1 | * @param callable $f |
|
48 | 1 | * @param callable $g |
|
49 | * @param mixed $x |
||
50 | * @param mixed $y |
||
51 | */ |
||
52 | public function __construct(callable $f, callable $g, $x, $y) |
||
53 | 1 | { |
|
54 | $this->f = $f; |
||
55 | 1 | $this->g = $g; |
|
56 | $this->x = $x; |
||
57 | $this->y = $y; |
||
58 | } |
||
59 | |||
60 | /** |
||
61 | 1 | * @psalm-return BType |
|
62 | */ |
||
63 | public function __invoke() |
||
66 | } |
||
67 | |||
68 | /** |
||
69 | * @param callable $a |
||
70 | * |
||
71 | * @return Closure |
||
72 | */ |
||
73 | public static function on(callable $a): Closure |
||
84 |