| Total Complexity | 4 |
| Total Lines | 31 |
| Duplicated Lines | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 6 | final class FixedArityFn implements FixedArityInterface |
||
| 7 | { |
||
| 8 | /** |
||
| 9 | * @type integer |
||
| 10 | */ |
||
| 11 | private $arity; |
||
| 12 | |||
| 13 | /** |
||
| 14 | * @type callable |
||
| 15 | */ |
||
| 16 | private $fn; |
||
| 17 | |||
| 18 | private function __construct(int $arity, callable $fn) |
||
| 19 | { |
||
| 20 | $this->arity = $arity; |
||
| 21 | $this->fn = $fn; |
||
| 22 | } |
||
| 23 | |||
| 24 | public function getArity(): int |
||
| 27 | } |
||
| 28 | |||
| 29 | public static function of(int $arity, callable $fn): self |
||
| 30 | { |
||
| 31 | return new static($arity, $fn); |
||
| 32 | } |
||
| 33 | |||
| 34 | public function __invoke(...$args) |
||
| 37 | } |
||
| 38 | } |
||
| 39 |