当前位置: 首页>>代码示例>>PHP>>正文


PHP Command::setAliases方法代码示例

本文整理汇总了PHP中Symfony\Component\Console\Command\Command::setAliases方法的典型用法代码示例。如果您正苦于以下问题:PHP Command::setAliases方法的具体用法?PHP Command::setAliases怎么用?PHP Command::setAliases使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Symfony\Component\Console\Command\Command的用法示例。


在下文中一共展示了Command::setAliases方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: testBundleCommandCanBeFoundByAlias

 public function testBundleCommandCanBeFoundByAlias()
 {
     $command = new Command('example');
     $command->setAliases(array('alias'));
     $bundle = $this->createBundleMock(array($command));
     $kernel = $this->getKernel(array($bundle));
     $application = new Application($kernel);
     $this->assertSame($command, $application->find('alias'));
 }
开发者ID:symfony,项目名称:symfony,代码行数:9,代码来源:ApplicationTest.php

示例2: testBundleCommandCanBeFoundByAlias

 public function testBundleCommandCanBeFoundByAlias()
 {
     $bundle = $this->getMock('Symfony\\Component\\HttpKernel\\Bundle\\Bundle');
     $bundle->expects($this->once())->method('registerCommands');
     $kernel = $this->getKernel(array($bundle));
     $application = new Application($kernel);
     $command = new Command('example');
     $command->setAliases(array('alias'));
     $application->add($command);
     $this->assertSame($command, $application->find('alias'));
 }
开发者ID:Ener-Getick,项目名称:symfony,代码行数:11,代码来源:ApplicationTest.php

示例3: registerConfigCommandAlias

 /**
  * @param \Symfony\Component\Console\Command\Command $command
  */
 protected function registerConfigCommandAlias(Command $command)
 {
     if ($this->hasConfigCommandAliases()) {
         foreach ($this->config['commands']['aliases'] as $alias) {
             if (!is_array($alias)) {
                 continue;
             }
             $aliasCommandName = key($alias);
             $commandString = $alias[$aliasCommandName];
             list($originalCommand) = explode(' ', $commandString);
             if ($command->getName() == $originalCommand) {
                 $currentCommandAliases = $command->getAliases();
                 $currentCommandAliases[] = $aliasCommandName;
                 $command->setAliases($currentCommandAliases);
             }
         }
     }
 }
开发者ID:jsiefer,项目名称:n98-magerun2,代码行数:21,代码来源:Application.php

示例4: setAliases

 /**
  * {@inheritdoc}
  */
 public function setAliases($aliases)
 {
     $this->decoratedCommand->setAliases($aliases);
     return $this;
 }
开发者ID:frankdejonge,项目名称:locked-console-command,代码行数:8,代码来源:LockedCommandDecorator.php

示例5: setAliases

 public function setAliases($aliases)
 {
     return $this->innerCommand->setAliases($aliases);
 }
开发者ID:lolautruche,项目名称:ezsh,代码行数:4,代码来源:WrappedCommand.php

示例6: configure

 /**
  * Configures a console command by setting name, description, arguments, etc.
  *
  * @param Command $command
  */
 public static function configure(Command $command)
 {
     $command->setName('config:status');
     $command->setAliases(['status']);
     $command->setDescription('Shows the current migration status.');
 }
开发者ID:baleen,项目名称:cli,代码行数:11,代码来源:StatusMessage.php

示例7: configure

 /**
  * @inheritdoc
  */
 public static function configure(Command $command)
 {
     $command->setName('config:init');
     $command->setAliases(['init']);
     $command->setDescription('Initialises Baleen by creating a config file in the current directory.');
 }
开发者ID:baleen,项目名称:cli,代码行数:9,代码来源:InitMessage.php

示例8: registerConfigCommandAlias

 /**
  * @param Command $command
  */
 public function registerConfigCommandAlias(Command $command)
 {
     foreach ($this->getArray(array('commands', 'aliases')) as $alias) {
         if (!is_array($alias)) {
             continue;
         }
         $aliasCommandName = key($alias);
         $commandString = $alias[$aliasCommandName];
         list($originalCommand) = explode(' ', $commandString, 2);
         if ($command->getName() !== $originalCommand) {
             continue;
         }
         $command->setAliases(array_merge($command->getAliases(), array($aliasCommandName)));
     }
 }
开发者ID:netz98,项目名称:n98-magerun,代码行数:18,代码来源:Config.php


注:本文中的Symfony\Component\Console\Command\Command::setAliases方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。