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