Webmozart\Console\Api\Config\SubCommandConfig::__construct PHP Method

__construct() public method

Creates a new configuration.
public __construct ( string $name = null, CommandConfig $parentConfig = null )
$name string The name of the command.
$parentConfig CommandConfig The command configuration that contains this configuration.
    public function __construct($name = null, CommandConfig $parentConfig = null)
    {
        parent::__construct($name);
        if ($parentConfig) {
            $this->setParentConfig($parentConfig);
        }
    }

Usage Example

 /**
  * Creates a new configuration.
  *
  * @param string            $name              The long option name of the command.
  * @param string            $shortName         The short option name of the command.
  * @param CommandConfig     $parentConfig      The parent configuration.
  * @param ApplicationConfig $applicationConfig The application configuration.
  */
 public function __construct($name = null, $shortName = null, CommandConfig $parentConfig = null, ApplicationConfig $applicationConfig = null)
 {
     parent::__construct($name, $parentConfig, $applicationConfig);
     $this->setShortName($shortName);
 }