| Total Complexity | 3 |
| Total Lines | 35 |
| Duplicated Lines | 0 % |
| Coverage | 100% |
| Changes | 0 | ||
| 1 | <?php |
||
| 15 | final class Omega extends Combinator |
||
| 16 | { |
||
| 17 | /** |
||
| 18 | * @var callable |
||
| 19 | */ |
||
| 20 | private $f; |
||
| 21 | |||
| 22 | /** |
||
| 23 | * Omega constructor. |
||
| 24 | * |
||
| 25 | * @psalm-param callable $f |
||
| 26 | * |
||
| 27 | * @param callable $f |
||
| 28 | */ |
||
| 29 | 2 | public function __construct(callable $f) |
|
| 32 | 2 | } |
|
| 33 | |||
| 34 | /** |
||
| 35 | * @psalm-return ResultType |
||
| 36 | */ |
||
| 37 | 2 | public function __invoke() |
|
| 38 | { |
||
| 39 | 2 | return ($this->f)($this->f)(($this->f)($this->f)); |
|
| 40 | } |
||
| 41 | |||
| 42 | /** |
||
| 43 | * @param callable $a |
||
| 44 | * |
||
| 45 | * @return Closure |
||
| 46 | */ |
||
| 47 | 2 | public static function on(callable $a) |
|
| 50 | } |
||
| 51 | } |
||
| 52 |