當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。