Webmozart\Console\Api\Config\ApplicationConfig::setDisplayName PHP Method

setDisplayName() public method

Sets the application name as it is displayed in the help.
See also: getDisplayName()
public setDisplayName ( string $displayName ) : static
$displayName string The display name.
return static The current instance.
    public function setDisplayName($displayName)
    {
        if (null !== $displayName) {
            Assert::string($displayName, 'The display name must be a string. Got: %s');
            Assert::notEmpty($displayName, 'The display name must not be empty.');
        }
        $this->displayName = $displayName;
        return $this;
    }

Usage Example

Ejemplo n.º 1
0
 /**
  * @expectedException \InvalidArgumentException
  */
 public function testSetDisplayNameFailsIfNoString()
 {
     $this->config->setDisplayName(1234);
 }