diff options
author | Christian Schneider | 2019-03-19 13:38:58 +0100 |
---|---|---|
committer | Christian Schneider | 2019-03-19 13:40:40 +0100 |
commit | a706afe8b32ed708b04a91c78d66f6faacbd4740 (patch) | |
tree | 61a44e50a4e56d94e69c64b855b496728e743a82 | |
parent | 2ea5b7afb01c78b87176f21356197bc8fb617023 (diff) | |
download | itools-a706afe8b32ed708b04a91c78d66f6faacbd4740.tar.gz itools-a706afe8b32ed708b04a91c78d66f6faacbd4740.tar.bz2 itools-a706afe8b32ed708b04a91c78d66f6faacbd4740.zip |
Replace func_get_args/call_user_func with the more concise ...-notation
-rw-r--r-- | it_pipe.class | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/it_pipe.class b/it_pipe.class index 7408f69..611c2ad 100644 --- a/it_pipe.class +++ b/it_pipe.class @@ -230,11 +230,9 @@ function lines() * @param $cmd command to execute, with {foo} for parameters * @param $args assoc array of arguments, see it::exec */ -function pipe(/* $cmd, $args */) +function pipe($cmd, ...$args) { - $args = func_get_args(); - $cmd = call_user_func_array('it::shell_command', $args); - + $cmd = it::shell_command($cmd, ...$args); $descriptors = array(0 => array("pipe", "r"), 1 => array("pipe", "w")); $process = proc_open($cmd, $descriptors, $pipes); |