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


PHP HelperSet::get方法代码示例

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


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

示例1: ask

 /**
  * {@inheritdoc}
  */
 public function ask($question, $default = NULL)
 {
     /** @var QuestionHelper $helper */
     $helper = $this->helperSet->get('question');
     $question = new ConfirmationQuestion($question, $default);
     return $helper->ask($this->input, $this->output, $question);
 }
开发者ID:brighten01,项目名称:opencloud-zendframework,代码行数:10,代码来源:IO.php

示例2: getPrompter

 /**
  * @return \PhpSpec\Console\Prompter
  */
 public function getPrompter()
 {
     if ($this->helperSet->has('question')) {
         return new Question($this->input, $this->output, $this->helperSet->get('question'));
     }
     return new Dialog($this->output, $this->helperSet->get('dialog'));
 }
开发者ID:EnmanuelCode,项目名称:backend-laravel,代码行数:10,代码来源:Factory.php

示例3: ask

 /**
  * @param string $question
  * @param null   $default
  *
  * @return string
  */
 protected function ask($question, $default = null)
 {
     /** @var \Symfony\Component\Console\Helper\QuestionHelper $helper */
     $helper = $this->helperSet->get('question');
     $question = new Question($question, $default);
     return $helper->ask($this->input, $this->getErrorOutput(), $question);
 }
开发者ID:ptondereau,项目名称:laravel-packme,代码行数:13,代码来源:AbstractBaseCommand.php

示例4: chosen

 /**
  * read the input and return a Configuration, returns `false` if the config
  * is not supported
  * @return Connection|null
  */
 public function chosen()
 {
     if ($this->helperSet->has($this->helperName)) {
         $connectionHelper = $this->helperSet->get($this->helperName);
         if ($connectionHelper instanceof ConnectionHelper) {
             return $connectionHelper->getConnection();
         }
     }
     return null;
 }
开发者ID:DIPcom,项目名称:Sandmin,代码行数:15,代码来源:ConnectionHelperLoader.php

示例5: ask

 /**
  * {@inheritdoc}
  */
 public function ask($question, $default = NULL)
 {
     if ($this->output->getVerbosity() === OutputInterface::VERBOSITY_QUIET) {
         return FALSE;
     }
     /** @var QuestionHelper $helper */
     $helper = $this->helperSet->get('question');
     $question = new ConfirmationQuestion($question, $default);
     return $helper->ask($this->input, $this->output, $question);
 }
开发者ID:nunodotferreira,项目名称:ApiGen,代码行数:13,代码来源:IO.php

示例6: createCommand

 /**
  * @param HelperSet $helpers
  * @return TravisCiCommand
  * @throws \Symfony\Component\Console\Exception\InvalidArgumentException
  * @throws \Symfony\Component\Console\Exception\LogicException
  */
 public static function createCommand(HelperSet $helpers)
 {
     /** @var QuestionHelper $questionHelper */
     $questionHelper = $helpers->get('question');
     $travisCiQuestionHelper = new TravisCiQuestionHelper($questionHelper);
     /** @var PackageHelper $packageHelper */
     $packageHelper = $helpers->get('package');
     $configBuilder = new ConfigBuilder($travisCiQuestionHelper, $packageHelper);
     $configWriter = new ConfigWriter();
     return new TravisCiCommand($travisCiQuestionHelper, $configBuilder, $configWriter);
 }
开发者ID:quickstrap,项目名称:quickstrap,代码行数:17,代码来源:TravisCiCommandFactory.php

示例7: ArrayInput

 function it_should_execute_when_calling_fire_action(QuestionHelper $question, HelperSet $helpers)
 {
     $helpers->get('question')->willReturn($question);
     $input = new ArrayInput([]);
     $output = new NullOutput();
     $query = Argument::type('Symfony\\Component\\Console\\Question\\ChoiceQuestion');
     $question->ask($input, $output, $query)->willReturn(1);
     $helpers->get('question')->willReturn($question);
     $this->setHelperSet($helpers);
     $this->run($input, $output);
     $this->fire();
 }
开发者ID:h2akim,项目名称:backup,代码行数:12,代码来源:BackupCommandRestoreSpec.php

示例8: select

 /**
  * {@inheritDoc}
  */
 public function select($question, $choices, $default, $attempts = false, $errorMessage = 'Value "%s" is invalid', $multiselect = false)
 {
     if ($this->isInteractive()) {
         return $this->helperSet->get('dialog')->select($this->getErrorOutput(), $question, $choices, $default, $attempts, $errorMessage, $multiselect);
     }
     return $default;
 }
开发者ID:Rudloff,项目名称:composer,代码行数:10,代码来源:ConsoleIO.php

示例9: choose

 /**
  * Asks user to choose.
  *
  * @param string $question      The question to ask.
  * @param array  $options       Valid answer options.
  * @param mixed  $default       Default answer.
  * @param string $error_message Error on incorrect answer.
  *
  * @return mixed
  */
 public function choose($question, array $options, $default, $error_message)
 {
     /** @var QuestionHelper $helper */
     $helper = $this->_helperSet->get('question');
     $choice_question = new ChoiceQuestion('<question>' . $question . '</question> ', $options, $default);
     $choice_question->setErrorMessage($error_message);
     return $helper->ask($this->_input, $this->_output, $choice_question);
 }
开发者ID:console-helpers,项目名称:console-kit,代码行数:18,代码来源:ConsoleIO.php

示例10:

 function it_dumps_field_filters(OutputInterface $output, HelperSet $helperSet, TableHelper $table)
 {
     $output->writeln(Argument::any())->shouldBeCalled();
     $helperSet->get('table')->willReturn($table);
     $headers = ['field', 'filter_class', 'operators'];
     $table->setHeaders($headers)->shouldBeCalled()->willReturn($table);
     $table->setRows(Argument::any())->shouldBeCalled();
     $table->render(Argument::any())->shouldBeCalled();
     $this->dump($output, $helperSet);
 }
开发者ID:abdeldayem,项目名称:pim-community-dev,代码行数:10,代码来源:FieldFilterDumperSpec.php

示例11:

 function it_dumps_field_filters(OutputInterface $output, HelperSet $helperSet, TableHelper $table, $repository)
 {
     $output->writeln(Argument::any())->shouldBeCalled();
     $repository->findAll()->willReturn([]);
     $helperSet->get('table')->willReturn($table);
     $headers = ['attribute', 'localizable', 'scopable', 'attribute type', 'filter_class', 'operators'];
     $table->setHeaders($headers)->shouldBeCalled()->willReturn($table);
     $table->setRows(Argument::any())->shouldBeCalled();
     $table->render(Argument::any())->shouldBeCalled();
     $this->dump($output, $helperSet);
 }
开发者ID:abdeldayem,项目名称:pim-community-dev,代码行数:11,代码来源:AttributeFilterDumperSpec.php

示例12: NullOutput

 function it_should_execute_when_calling_fire_action(QuestionHelper $question, HelperSet $helpers)
 {
     $app = Mockery::mock('Illuminate\\Contracts\\Foundation\\Application');
     $app->shouldReceive('call')->andReturn(true);
     $input = Mockery::mock('Symfony\\Component\\Console\\Input\\ArrayInput');
     $input->shouldReceive('bind');
     $input->shouldReceive('isInteractive')->andReturn(false);
     $input->shouldReceive('hasArgument')->andReturn(false);
     $input->shouldReceive('validate')->andReturn(false);
     $input->shouldReceive('getOption')->andReturn(false);
     $this->setLaravel($app);
     $helpers->get('question')->willReturn($question);
     $output = new NullOutput();
     $query = Argument::type('Symfony\\Component\\Console\\Question\\ChoiceQuestion');
     $question->ask($input, $output, $query)->willReturn(1);
     $helpers->get('question')->willReturn($question);
     $this->setHelperSet($helpers);
     $this->run($input, $output);
     $this->fire();
 }
开发者ID:bradcornford,项目名称:Backup,代码行数:20,代码来源:BackupCommandRestoreSpec.php

示例13: yes

 /**
  * If the user answers yes then we can override the file
  * or if the file doesn't exist then we will just answer
  * yes because we aren't overriding anything.
  *
  * @param  string 			$filename
  * @param  OutputInterface	$output
  * @param  HelperSet 		$helperSet
  * @return boolean
  */
 protected function yes($filename, $output, $helperSet, $options)
 {
     if (!$this->file->exists($this->basePath . '/' . $filename)) {
         return true;
     }
     if (isset($options['yes']) && $options['yes'] == true) {
         return true;
     }
     $dialog = $helperSet->get('dialog');
     if ($dialog->askConfirmation($output, "<question>Would you like to override {$filename}? [y/N]</question>", false)) {
         return true;
     }
     return false;
 }
开发者ID:codesleeve,项目名称:generator,代码行数:24,代码来源:FileWriter.php

示例14: dump

 /**
  * {@inheritdoc}
  */
 public function dump(OutputInterface $output, HelperSet $helperSet)
 {
     $output->writeln("<info>Useable attributes filters...</info>");
     $attributeFilters = $this->getAttributeFilters();
     $attributes = $this->repository->findAll();
     $rows = [];
     foreach ($attributes as $attribute) {
         $rows = array_merge($rows, $this->getFilterInformationForAttribute($attribute, $attributeFilters));
     }
     $table = $helperSet->get('table');
     $headers = ['attribute', 'localizable', 'scopable', 'attribute type', 'operators', 'filter_class'];
     $table->setHeaders($headers)->setRows($rows);
     $table->render($output);
 }
开发者ID:a2xchip,项目名称:pim-community-dev,代码行数:17,代码来源:AttributeFilterDumper.php

示例15: dump

 /**
  * {@inheritdoc}
  */
 public function dump(OutputInterface $output, HelperSet $helperSet)
 {
     $output->writeln("<info>Useable field filters...</info>");
     $rows = [];
     foreach ($this->registry->getFieldFilters() as $filter) {
         $class = get_class($filter);
         $operators = implode(', ', $filter->getOperators());
         foreach ($filter->getFields() as $field) {
             $rows[] = [$field, $operators, $class];
         }
     }
     $headers = ['field', 'operators', 'filter_class'];
     $table = $helperSet->get('table');
     $table->setHeaders($headers)->setRows($rows);
     $table->render($output);
 }
开发者ID:a2xchip,项目名称:pim-community-dev,代码行数:19,代码来源:FieldFilterDumper.php


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