New toolbar command

@param   ControllerToolbarCommand $command  A ControllerToolbarCommand object
@return  void
547734
protected function _commandNew(ControllerToolbarCommand $command)
    {
        if (empty($command->href))
        {
            $controller    = $this->getController();
            $identifier    = $controller->getIdentifier();
            $command->href = $controller->getView()->getRoute('component='.$identifier->package.'&view='.$identifier->name);
        }

        $command->icon = 'k-icon-plus';
    }
1130097
public function addCommand($command)
    {
        if (is_string($command)) {
            $command = $this->app->make($command);
        }

        if ($command instanceof Command) {
            $command->setLaravel($this->app);
        }

        $this->console->add($command);
    }
1262197
public function add(\Strukt\Console\Command $command){

		$class = get_class($command);
		$docBlockParser = new \Strukt\Console\DocBlockParser($class);
		$docList = $docBlockParser->parse();

		$cmdAlias = $docList["command"]["alias"];
		$this->commands[$cmdAlias]["object"] = $command;
		$this->commands[$cmdAlias]["docparser"] = $docBlockParser;
		$this->commands[$cmdAlias]["doclist"] = $docList;

		if($this->padlen == 0 || strlen($docList["command"]["alias"]) > $this->padlen)
			$this->padlen = strlen($docList["command"]["alias"]);
	}
97408
public static function create(Command $command): CommandMessage
    {
        $timestamp = DateTime::now();
        $id = MessageId::generate();
        $metaData = MetaData::create();

        return new static($id, $timestamp, $command, $metaData);
    }
758856
protected function _commandView($command)
    {
        $entity = $this->getController()->getItem();
        $command->append(array('label' => AnTranslator::_('COM-ARTICLES-ARTICLE-CURRENT-VERSION')));
        $command->href('option=com_articles&view=article&id='.$entity->parent->id);
    }
958712
final public function handle(Command $command): void
    {
        $supportedCommandType = $this->getSupportedCommandType();
        if (!\is_a($command, $supportedCommandType)) {
            throw new InvalidCommandException(\sprintf(
                'Command must be a %s, %s given',
                $supportedCommandType,
                \get_class($command)
            ));
        }

        $this->handleCommand($command);
    }
827823
protected function _commandSubscribe($command)
    {
        $entity = $this->getController()->getItem();

        $action = ($entity->subscribed(get_viewer()) ? 'unsubscribe' : 'subscribe');
        $label = AnTranslator::_('LIB-AN-ACTION-'.strtoupper($action));

        $command->append(array('label' => $label))
            ->href($entity->getURL())
            ->class('action-'.$action)
            ->setAttribute('data-action', $action);
    }
472454
private function createCommand() : Command\Hook
    {
        /* @var \CaptainHook\App\Console\Command\Hook $command */
        $class   = '\\CaptainHook\\App\\Console\\Command\\Hook\\' . Util::getHookCommand($this->hookToExecute);
        $command = new $class($this->getConfigFile(), $this->getRepositoryPath());
        $command->setHelperSet($this->getHelperSet());

        return $command;
    }
1173658
public function fire(Command $command)
    {
        $this->command = $command;

        $connected = false;

        while (! $connected) {
            $host = $this->askDatabaseHost();

            $name = $this->askDatabaseName();

            $user = $this->askDatabaseUsername();

            $password = $this->askDatabasePassword();

            $this->setLaravelConfiguration($name, $user, $password, $host);

            if ($this->databaseConnectionIsValid()) {
                $connected = true;
            } else {
                $command->error('Please ensure your database credentials are valid.');
            }
        }

        $this->env->write($name, $user, $password, $host);

        $command->info('Database successfully configured');
    }
339054
public function command($command, $method) {

        self::$commands[] = $command;
        self::$callbacks[$command] = $method;
    }
517125
public function addCommand($command)
    {
        $command = $this->resolveCommandObject($command);

        /*
         * At this stage we definitely have a proper command to use.
         *
         * @var Command $command
         */
        $this->commands[$command->getName()] = $command;

        $aliases = $command->getAliases();

        if (empty($aliases)) {
            return $this;
        }

        foreach ($command->getAliases() as $alias) {
            if (isset($this->commands[$alias])) {
                throw new TelegramSDKException(sprintf(
                    '[Error] Alias [%s] conflicts with command name of "%s" try with another name or remove this alias from the list.',
                    $alias,
                    get_class($command)
                ));
            }

            if (isset($this->commandAliases[$alias])) {
                throw new TelegramSDKException(sprintf(
                    '[Error] Alias [%s] conflicts with another command\'s alias list: "%s", try with another name or remove this alias from the list.',
                    $alias,
                    get_class($command)
                ));
            }

            $this->commandAliases[$alias] = $command;
        }

        return $this;


    }
1199305
protected function registerMakeRuleCommand($command)
     {
         $this->app->singleton($command, function ($app) {
             return new Generators\Commands\RuleMakeCommand($app);
         });
     }
869664
public function beforeCommand(Event $event, Command $command)
    {
        $parameters = $command->parseParameters([], ['h' => 'help']);

        if (
            count($parameters) < ($command->getRequiredParams() + 1) ||
            $command->isReceivedOption(['help', 'h', '?']) ||
            in_array($command->getOption(1), ['help', 'h', '?'])
        ) {
            $command->getHelp();

            return false;
        }

        if( !defined('BASE_PATH') ) {
            throw new CommandsException('Commands need a BASE_PATH constant defined.');
        }

        if ($command->canBeExternal() == false) {
            $path = $command->getOption('directory');
            if (!file_exists($path.'.phalcon')) {
                throw new CommandsException('This command should be invoked inside a Phalcon project directory.');
            }
        }

        return true;
    }
184130
public function handle(Command $command)
    {
        $handler = $this->container->make($this->handlerName);

        return $handler->handle($command);
    }
1310430
public function fireInstallingCommand(Command $command)
    {
        $this->handleMainCommand($command);

        event(new SystemWasInstalledEvent());

        $command->info('System was installed!');
    }
170880
protected function _commandDelete($command)
    {
        $entity = $this->getController()->getItem();

        $command->append(array('label' => AnTranslator::_('LIB-AN-ACTION-DELETE')))
        ->href(route($entity->getURL()))
        ->setAttribute('data-action', 'delete')
        ->setAttribute('data-redirect', route('index.php?option=com_locations&view=locations'))
        ->class('action-delete');
    }
930155
protected function _commandView($command)
    {
        $entity = $this->getController()->getItem();
        $label = sprintf(AnTranslator::_('COM-STORIES-VIEW-ALL-COMMENTS'), $entity->getNumOfComments());
        $command->append(array('label' => $label));
        $command->href(route($entity->getURL()));
    }