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

setVersion() public method

Sets the version of the application.
public setVersion ( string $version ) : static
$version string The application version.
return static The current instance.
    public function setVersion($version)
    {
        if (null !== $version) {
            Assert::string($version, 'The application version must be a string. Got: %s');
            Assert::notEmpty($version, 'The application version must not be empty.');
        }
        $this->version = $version;
        return $this;
    }

Usage Example

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