本文整理匯總了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'));
}
示例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;
}
示例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();
}
示例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');
}