Changeset View
Changeset View
Standalone View
Standalone View
branches/5.3.x/core/kernel/Console/Command/BuildClassMapCommand.php
Show All 10 Lines | |||||
* or other free or open source software licenses. | * or other free or open source software licenses. | ||||
* See http://www.in-portal.org/license for copyright notices and details. | * See http://www.in-portal.org/license for copyright notices and details. | ||||
*/ | */ | ||||
namespace InPortal\Core\kernel\Console\Command; | namespace InPortal\Core\kernel\Console\Command; | ||||
use InPortal\Core\kernel\utility\ClassDiscovery\ClassMapBuilder; | use InPortal\Core\kernel\utility\ClassDiscovery\ClassMapBuilder; | ||||
use Stecman\Component\Symfony\Console\BashCompletion\Completion\CompletionAwareInterface; | |||||
use Stecman\Component\Symfony\Console\BashCompletion\CompletionContext; | use Stecman\Component\Symfony\Console\BashCompletion\CompletionContext; | ||||
use Symfony\Component\Console\Input\InputInterface; | use Symfony\Component\Console\Input\InputInterface; | ||||
use Symfony\Component\Console\Input\InputOption; | use Symfony\Component\Console\Input\InputOption; | ||||
use Symfony\Component\Console\Output\OutputInterface; | use Symfony\Component\Console\Output\OutputInterface; | ||||
defined('FULL_PATH') or die('restricted access!'); | defined('FULL_PATH') or die('restricted access!'); | ||||
class BuildClassMapCommand extends AbstractCommand implements CompletionAwareInterface | class BuildClassMapCommand extends AbstractCommand | ||||
{ | { | ||||
/** | /** | ||||
* Configures the current command. | * Configures the current command. | ||||
* | * | ||||
* @return void | * @return void | ||||
*/ | */ | ||||
protected function configure() | protected function configure() | ||||
▲ Show 20 Lines • Show All 60 Lines • ▼ Show 20 Line(s) | |||||
* | * | ||||
* @param string $optionName Option name. | * @param string $optionName Option name. | ||||
* @param CompletionContext $context Completion context. | * @param CompletionContext $context Completion context. | ||||
* | * | ||||
* @return array | * @return array | ||||
*/ | */ | ||||
public function completeOptionValues($optionName, CompletionContext $context) | public function completeOptionValues($optionName, CompletionContext $context) | ||||
{ | { | ||||
$suggestions = parent::completeOptionValues($optionName, $context); | |||||
if ( $optionName === 'module' ) { | if ( $optionName === 'module' ) { | ||||
return $this->getModules(); | return $this->getModules(); | ||||
} | } | ||||
return array(); | return $suggestions; | ||||
} | } | ||||
/** | /** | ||||
* Returns possible module names. | * Returns possible module names. | ||||
* | * | ||||
* @return array | * @return array | ||||
*/ | */ | ||||
protected function getModules() | protected function getModules() | ||||
{ | { | ||||
$modules = array_keys($this->Application->ModuleInfo); | $modules = array_keys($this->Application->ModuleInfo); | ||||
return array_diff($modules, array('In-Portal')); | return array_diff($modules, array('In-Portal')); | ||||
} | } | ||||
/** | |||||
* Return possible values for the named argument. | |||||
* | |||||
* @param string $argumentName Argument name. | |||||
* @param CompletionContext $context Completion context. | |||||
* | |||||
* @return array | |||||
*/ | |||||
public function completeArgumentValues($argumentName, CompletionContext $context) | |||||
{ | |||||
return array(); | |||||
} | |||||
} | } |