本文整理汇总了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');
}