protected function initialize(InputInterface $input, OutputInterface $output) { $this->assertTaggingIsDisabled(); $ic = new InformationCollector(); $ic->registerStandardRequest('type'); $this->getContext()->setService('information-collector', $ic); $this->getContext()->setService('output', $this->output); $this->getContext()->getInformationCollector()->handleCommandInput($input); $currentVersion = $this->getContext()->getVersionDetector()->getCurrentVersion(); $this->getContext()->setParameter('current-version', $currentVersion); }
protected function loadInformationCollector() { $ic = new InformationCollector(); // Add a specific option if it's the first release $version = $this->getContext()->getVersionPersister()->getCurrentVersion(); if ($version->isInitial()) { $ic->registerRequest(new InformationRequest('confirm-first', array('description' => 'This is the first release for the current branch', 'type' => 'confirmation'))); } // the release task requires the type option $ic->registerStandardRequest('type'); // Register options of all lists (prerequistes and actions) foreach (array('prerequisites', 'preReleaseActions', 'postReleaseActions') as $listName) { foreach ($this->getContext()->getList($listName) as $listItem) { $ic->registerRequests($listItem->getInformationRequests()); } } $this->getContext()->setService('information-collector', $ic); }