Webmozart\Console\Api\Config\CommandConfig::setProcessTitle PHP Method

setProcessTitle() public method

Sets the title of the command process.
See also: getProcessTitle()
public setProcessTitle ( string | null $processTitle ) : static
$processTitle string | null The process title or `null` if no title should be set.
return static The current instance.
    public function setProcessTitle($processTitle)
    {
        if (null !== $processTitle) {
            Assert::string($processTitle, 'The command process title must be a string or null. Got: %s');
            Assert::notEmpty($processTitle, 'The command process title must not be empty.');
        }
        $this->processTitle = $processTitle;
        return $this;
    }

Usage Example

示例#1
0
 /**
  * @expectedException \InvalidArgumentException
  */
 public function testSetProcessTitleFailsIfNotString()
 {
     $this->config->setProcessTitle(1234);
 }