本文整理匯總了PHP中Symfony\Component\Process\ProcessUtils::validateInput方法的典型用法代碼示例。如果您正苦於以下問題:PHP ProcessUtils::validateInput方法的具體用法?PHP ProcessUtils::validateInput怎麽用?PHP ProcessUtils::validateInput使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Symfony\Component\Process\ProcessUtils
的用法示例。
在下文中一共展示了ProcessUtils::validateInput方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: write
/**
* Appends an input to the write buffer.
*
* @param resource|scalar|\Traversable|null The input to append as stream resource, scalar or \Traversable
*/
public function write($input)
{
if (null === $input) {
return;
}
if ($this->isClosed()) {
throw new RuntimeException(sprintf('%s is closed', static::class));
}
$this->input[] = ProcessUtils::validateInput(__METHOD__, $input);
}
示例2: setStdin
/**
* Sets the contents of STDIN.
*
* @param string|null $stdin The new contents
*
* @return self The current Process instance
*
* @throws LogicException In case the process is running
* @throws InvalidArgumentException In case the argument is invalid
*/
public function setStdin($stdin)
{
if ($this->isRunning()) {
throw new LogicException('STDIN can not be set while the process is running.');
}
$this->stdin = ProcessUtils::validateInput(sprintf('%s::%s', __CLASS__, __FUNCTION__), $stdin);
return $this;
}
示例3: setInput
/**
* Sets the input of the process.
*
* @param string|null $input The input as a string
*
* @return ProcessBuilder
*
* @throws InvalidArgumentException In case the argument is invalid
*/
public function setInput($input)
{
$this->input = ProcessUtils::validateInput(sprintf('%s::%s', __CLASS__, __FUNCTION__), $input);
return $this;
}
示例4: setInput
/**
* Sets the input of the process.
*
* @param mixed $input The input as a string
*
* @return ProcessBuilder
*
* @throws InvalidArgumentException In case the argument is invalid
*/
public function setInput($input)
{
$this->input = ProcessUtils::validateInput(__METHOD__, $input);
return $this;
}
示例5: setInput
/**
* Sets the input.
*
* This content will be passed to the underlying process standard input.
*
* @param resource|scalar|\Traversable|null $input The content
*
* @return self The current Process instance
*
* @throws LogicException In case the process is running
*/
public function setInput($input)
{
if ($this->isRunning()) {
throw new LogicException('Input can not be set while the process is running.');
}
$this->input = ProcessUtils::validateInput(__METHOD__, $input);
return $this;
}