summaryrefslogtreecommitdiff
path: root/it.class
diff options
context:
space:
mode:
Diffstat (limited to 'it.class')
-rw-r--r--it.class6
1 files changed, 2 insertions, 4 deletions
diff --git a/it.class b/it.class
index 6e294c3..098e57d 100644
--- a/it.class
+++ b/it.class
@@ -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));
}
/**