本文整理汇总了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;
}