X-Git-Url: http://www.aleph1.co.uk/gitweb/?a=blobdiff_plain;ds=sidebyside;f=vendor%2Fsymfony%2Fprocess%2FProcessUtils.php;fp=vendor%2Fsymfony%2Fprocess%2FProcessUtils.php;h=cbc95708ed4a6c5d1cee56fa189704c29b0f96a9;hb=9917807b03b64faf00f6a1f29dcb6eafc454efa5;hp=c0fd9c12dba5af3c30b3d013e69c125778c9de36;hpb=aea91e65e895364e460983b890e295aa5d5540a5;p=yaffs-website diff --git a/vendor/symfony/process/ProcessUtils.php b/vendor/symfony/process/ProcessUtils.php index c0fd9c12d..cbc95708e 100644 --- a/vendor/symfony/process/ProcessUtils.php +++ b/vendor/symfony/process/ProcessUtils.php @@ -83,8 +83,6 @@ class ProcessUtils * @return mixed The validated input * * @throws InvalidArgumentException In case the input is not valid - * - * Passing an object as an input is deprecated since version 2.5 and will be removed in 3.0. */ public static function validateInput($caller, $input) { @@ -98,14 +96,17 @@ class ProcessUtils if (is_scalar($input)) { return (string) $input; } - // deprecated as of Symfony 2.5, to be removed in 3.0 - if (is_object($input) && method_exists($input, '__toString')) { - @trigger_error('Passing an object as an input is deprecated since version 2.5 and will be removed in 3.0.', E_USER_DEPRECATED); - - return (string) $input; + if ($input instanceof Process) { + return $input->getIterator($input::ITER_SKIP_ERR); + } + if ($input instanceof \Iterator) { + return $input; + } + if ($input instanceof \Traversable) { + return new \IteratorIterator($input); } - throw new InvalidArgumentException(sprintf('%s only accepts strings or stream resources.', $caller)); + throw new InvalidArgumentException(sprintf('%s only accepts strings, Traversable objects or stream resources.', $caller)); } return $input;