src/macros/fn/compose.php 1 location
|
@@ 14-17 (lines=4) @@
|
11 |
|
P::macro('compose', function (...$fns): \Closure { |
12 |
|
$fnsCount = count($fns); |
13 |
|
|
14 |
|
if (1 === $fnsCount && is_array($fns[0])) { |
15 |
|
$fns = $fns[0]; |
16 |
|
$fnsCount = count($fns); |
17 |
|
} |
18 |
|
|
19 |
|
assert($fnsCount > 0, new \UnderflowException('compose requires at least one argument')); |
20 |
|
|
src/macros/fn/pipe.php 1 location
|
@@ 10-13 (lines=4) @@
|
7 |
|
P::macro('pipe', function (...$fns): \Closure { |
8 |
|
$fnsCount = count($fns); |
9 |
|
|
10 |
|
if (1 === $fnsCount && is_array($fns[0])) { |
11 |
|
$fns = $fns[0]; |
12 |
|
$fnsCount = count($fns); |
13 |
|
} |
14 |
|
|
15 |
|
assert($fnsCount > 0, new \UnderflowException('pipe requires at least one argument')); |
16 |
|
|