public static function ProcessUtils::validateInput in Zircon Profile 8
Same name and namespace in other branches
- 8.0 vendor/symfony/process/ProcessUtils.php \Symfony\Component\Process\ProcessUtils::validateInput()
Validates and normalizes a Process input.
Parameters
string $caller The name of method call that validates the input:
mixed $input The input to validate:
Return value
string 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.
2 calls to ProcessUtils::validateInput()
- Process::setInput in vendor/
symfony/ process/ Process.php - Sets the input.
- ProcessBuilder::setInput in vendor/
symfony/ process/ ProcessBuilder.php - Sets the input of the process.
File
- vendor/
symfony/ process/ ProcessUtils.php, line 89
Class
- ProcessUtils
- ProcessUtils is a bunch of utility methods.
Namespace
Symfony\Component\ProcessCode
public static function validateInput($caller, $input) {
if (null !== $input) {
if (is_resource($input)) {
return $input;
}
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;
}
throw new InvalidArgumentException(sprintf('%s only accepts strings or stream resources.', $caller));
}
return $input;
}