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


PHP Command::setHelperSet方法代码示例

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


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

示例1: simulateHelperSet

 public function simulateHelperSet(Command $command)
 {
     $this->dialog = $this->getMock("Symfony\\Component\\Console\\Helper\\DialogHelper");
     $helpers = array('dialog' => $this->dialog);
     $helperSet = new HelperSet($helpers);
     $command->setHelperSet($helperSet);
 }
开发者ID:bonndan,项目名称:release-flow,代码行数:7,代码来源:CommandTest.php

示例2: executeCommand

 protected static function executeCommand(Command $command, $siteDir)
 {
     if (!is_dir($siteDir)) {
         throw new \RuntimeException('The meinhof-site-dir (' . $siteDir . ') specified in composer.json was not found in ' . getcwd());
     }
     $helpers = new HelperSet(array(new FormatterHelper(), new DialogHelper()));
     $command->setHelperSet($helpers);
     $input = new ArrayInput(array('dir' => $siteDir));
     $output = new ConsoleOutput();
     $command->run($input, $output);
 }
开发者ID:miguelibero,项目名称:meinhof,代码行数:11,代码来源:ScriptHandler.php

示例3: setHelperSet

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

示例4: testCommandWithWrongInputsNumber

 /**
  * @expectedException \RuntimeException
  * @expectedMessage   Aborted
  */
 public function testCommandWithWrongInputsNumber()
 {
     $questions = array('What\'s your name?', 'How are you?', 'Where do you come from?');
     $command = new Command('foo');
     $command->setHelperSet(new HelperSet(array(new QuestionHelper())));
     $command->setCode(function ($input, $output) use($questions, $command) {
         $helper = $command->getHelper('question');
         $helper->ask($input, $output, new Question($questions[0]));
         $helper->ask($input, $output, new Question($questions[1]));
         $helper->ask($input, $output, new Question($questions[2]));
     });
     $tester = new CommandTester($command);
     $tester->setInputs(array('Bobby', 'Fine'));
     $tester->execute(array());
 }
开发者ID:Gladhon,项目名称:symfony,代码行数:19,代码来源:CommandTesterTest.php

示例5: setHelperSet

 public function setHelperSet(HelperSet $helperSet)
 {
     parent::setHelperSet($helperSet);
     $this->innerCommand->setHelperSet($helperSet);
 }
开发者ID:lolautruche,项目名称:ezsh,代码行数:5,代码来源:WrappedCommand.php

示例6: runDoctrineCommand

 /**
  * Adds options to a symfony command
  *
  * @param SymfonyCommand $command
  * @param array          $opt
  * @param array          $validOpts
  * @param array          $arg
  */
 protected function runDoctrineCommand(SymfonyCommand $command, array $opt = [], array $validOpts = [], array $arg = [])
 {
     $helperSet = $this->getEntityManagerHelperSet();
     $command->setHelperSet($helperSet);
     $command = $this->taskSymfonyCommand($command);
     foreach ($opt as $key => $value) {
         if (!in_array($key, $validOpts)) {
             continue;
         }
         $command->opt($key, $value);
     }
     foreach ($arg as $key => $value) {
         $command->arg($key, $value);
     }
     $command->run();
 }
开发者ID:indigophp,项目名称:robo-doctrine,代码行数:24,代码来源:loadOrmTasks.php


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