Lines Matching refs:input
33 * Validates and normalizes a Process input.
35 * @param string $caller The name of method call that validates the input
36 * @param mixed $input The input to validate
40 * @throws InvalidArgumentException In case the input is not valid
42 public static function validateInput(string $caller, $input)
44 if (null !== $input) {
45 if (\is_resource($input)) {
46 return $input;
48 if (\is_string($input)) {
49 return $input;
51 if (is_scalar($input)) {
52 return (string) $input;
54 if ($input instanceof Process) {
55 return $input->getIterator($input::ITER_SKIP_ERR);
57 if ($input instanceof \Iterator) {
58 return $input;
60 if ($input instanceof \Traversable) {
61 return new \IteratorIterator($input);
67 return $input;