/** * {@inheritdoc} */ public function isEnabled() { if (null === $this->profiler) { return false; } return parent::isEnabled(); }
/** * {@inheritDoc} */ public function isEnabled() { if (version_compare(phpversion(), '5.4.0', '<')) { return false; } return parent::isEnabled(); }
/** * {@inheritdoc} */ public function isEnabled() { if (!class_exists('Symfony\\Component\\Process\\Process')) { return false; } return parent::isEnabled(); }
/** * Adds a command object. * * If a command with the same name already exists, it will be overridden. * * @param Command $command A Command object * * @return Command The registered command * * @api */ public function add(Command $command) { $command->setApplication($this); if (!$command->isEnabled()) { $command->setApplication(null); return; } if (null === $command->getDefinition()) { throw new \LogicException(sprintf('Command class "%s" is not correctly initialized. You probably forgot to call the parent constructor.', get_class($command))); } $this->commands[$command->getName()] = $command; foreach ($command->getAliases() as $alias) { $this->commands[$alias] = $command; } return $command; }
/** * Adds a command object. * * If a command with the same name already exists, it will be overridden. * * @param Command $command A Command object * * @return Command The registered command * * @api */ public function add(Command $command) { $command->setApplication($this); if (!$command->isEnabled()) { $command->setApplication(null); return; } $this->commands[$command->getName()] = $command; foreach ($command->getAliases() as $alias) { $this->commands[$alias] = $command; } return $command; }
/** * {@inheritdoc} */ public function isEnabled() { return $this->decoratedCommand->isEnabled(); }
public function isEnabled() { return $this->innerCommand->isEnabled(); }
/** * {@inheritdoc} */ public function isEnabled() { $enabled = parent::isEnabled(); // Hide the command in the list, if necessary. if ($enabled && $this->hiddenInList) { global $argv; $enabled = !isset($argv[1]) || $argv[1] != 'list'; } return $enabled; }
/** * {@inheritdoc} */ public function isEnabled() { return class_exists(BaseLintCommand::class) && parent::isEnabled(); }