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

markDefault() public method

The names of default commands can be omitted when calling the command. For example, the following command can be called in two ways: php protected function configure() { $this ->beginCommand('add') ->markDefault() ->addArgument('host', Argument::REQUIRED) ->end() ... ; } The first way is to call the command regularly. The second way is to omit the name of the command: php $ ./console add localhost $ ./console localhost
public markDefault ( ) : static
return static The current instance.
    public function markDefault()
    {
        $this->default = true;
        $this->anonymous = false;
        return $this;
    }

Usage Example

示例#1
0
 public function testMarkDefault()
 {
     $this->assertFalse($this->config->isDefault());
     $this->assertFalse($this->config->isAnonymous());
     $this->config->markDefault();
     $this->assertTrue($this->config->isDefault());
     $this->assertFalse($this->config->isAnonymous());
 }
All Usage Examples Of Webmozart\Console\Api\Config\CommandConfig::markDefault