isEnabled() публичный Метод

Returns whether the command is enabled or not in the current environment.
public isEnabled ( ) : boolean
Результат boolean Returns `true` if the command is currently enabled and `false` otherwise.
Пример #1
0
 public function testEnableIf()
 {
     $this->config->enableIf(true);
     $this->assertTrue($this->config->isEnabled());
     $this->config->enableIf(false);
     $this->assertFalse($this->config->isEnabled());
 }
Пример #2
0
 private function addCommand(CommandConfig $config)
 {
     if (!$config->isEnabled()) {
         return;
     }
     $this->validateCommandName($config);
     $command = new Command($config, $this);
     $this->commands->add($command);
     if ($config->isDefault()) {
         $this->defaultCommands->add($command);
     }
     if (!$config->isAnonymous()) {
         $this->namedCommands->add($command);
     }
 }