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


PHP HelperSet::has方法代码示例

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


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

示例1: 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

示例2: 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

示例3: run

 /**
  * Runs the application using the given HelperSet
  *
  * This method is responsible for creating the console application, adding
  * relevant commands, and running it. Other code is responsible for producing
  * the HelperSet itself (your cli-config.php or bootstrap code), and for
  * calling this method (the actual bin command file).
  *
  * @param HelperSet $helperSet
  * @param Application $application
  * @throws \Doxport\Exception\Exception
  * @return integer 0 if everything went fine, or an error code
  */
 public static function run(HelperSet $helperSet, Application $application = null)
 {
     if (!$helperSet->has('em')) {
         throw new Exception('Helper set passed to Doxport console runner must have an entity manager ("em")');
     }
     if (!$application) {
         $application = new Application('Doxport relational data tool', Version::VERSION);
     }
     $application->setCatchExceptions(true);
     $application->setHelperSet($helperSet);
     $application->add(new ExportCommand());
     $application->add(new DeleteCommand());
     $application->add(new ImportCommand());
     return $application->run();
 }
开发者ID:vend,项目名称:doxport,代码行数:28,代码来源:ConsoleRunner.php

示例4: testHas

 /**
  * @covers \Symfony\Component\Console\Helper\HelperSet::has
  */
 public function testHas()
 {
     $helperset = new HelperSet(array('fake_helper_alias' => $this->getGenericMockHelper('fake_helper')));
     $this->assertTrue($helperset->has('fake_helper'), '->has() finds set helper');
     $this->assertTrue($helperset->has('fake_helper_alias'), '->has() finds set helper by alias');
 }
开发者ID:sintoris,项目名称:Known,代码行数:9,代码来源:HelperSetTest.php


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