Gush\Subscriber\CoreInitSubscriber::decorateDefinition PHP Method

decorateDefinition() public method

public decorateDefinition ( Symfony\Component\Console\Event\ConsoleCommandEvent $event )
$event Symfony\Component\Console\Event\ConsoleCommandEvent
    public function decorateDefinition(ConsoleCommandEvent $event)
    {
        $command = $event->getCommand();
        if (!$command instanceof InitCommand) {
            return;
        }
        $adapterName = $this->application->getConfig()->get('repo_adapter', Config::CONFIG_LOCAL, GitHelper::UNDEFINED_ADAPTER);
        $issueTracker = $this->application->getConfig()->get('issue_tracker', Config::CONFIG_LOCAL, GitHelper::UNDEFINED_ADAPTER);
        $command->addOption('repo-adapter', null, InputOption::VALUE_OPTIONAL, sprintf('Adapter-name of the repository-manager (%s)', $this->getSupportedAdapters(AdapterFactory::SUPPORT_REPOSITORY_MANAGER)), $adapterName)->addOption('issue-adapter', null, InputOption::VALUE_OPTIONAL, sprintf('Adapter-name of the issue-tracker (%s)', $this->getSupportedAdapters(AdapterFactory::SUPPORT_ISSUE_TRACKER)), $issueTracker)->addOption('org', 'o', InputOption::VALUE_REQUIRED, 'Name of the Git organization', $this->application->getConfig()->get('repo_org', Config::CONFIG_LOCAL, GitHelper::UNDEFINED_ORG))->addOption('repo', 'r', InputOption::VALUE_REQUIRED, 'Name of the Git repository', $this->application->getConfig()->get('repo_name', Config::CONFIG_LOCAL, GitHelper::UNDEFINED_REPO))->addOption('issue-org', 'io', InputOption::VALUE_REQUIRED, 'Name of the issue-tracker organization', $this->application->getConfig()->getFirstNotNull(['issue_project_org', 'repo_org'], Config::CONFIG_LOCAL, GitHelper::UNDEFINED_ORG))->addOption('issue-project', 'ip', InputOption::VALUE_REQUIRED, 'Repository/Project name of the issue-tracker', $this->application->getConfig()->getFirstNotNull(['issue_project', 'repo_name'], Config::CONFIG_LOCAL, GitHelper::UNDEFINED_REPO));
    }