diff options
Diffstat (limited to 'it.class')
-rw-r--r-- | it.class | 6 |
1 files changed, 2 insertions, 4 deletions
@@ -1228,11 +1228,9 @@ static function cat($p = null) */ static function pipe($cmd, ...$args) { - $values = []; - foreach ($args as $arg) - $values = array_merge($values, (array)$arg); + $args = array_reduce($args, fn($carry, $v) => array_merge($carry, (array)$v), []); # varargs to single arr - return new it_pipe(is_string($cmd) ? array('cmd' => $cmd, 'args' => $values) : array('data' => $cmd)); + return new it_pipe(is_string($cmd) ? array('cmd' => $cmd, 'args' => $args) : array('data' => $cmd)); } /** |