本文整理汇总了PHP中Symfony\Component\Console\Input\InputOption::__construct方法的典型用法代码示例。如果您正苦于以下问题:PHP InputOption::__construct方法的具体用法?PHP InputOption::__construct怎么用?PHP InputOption::__construct使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Symfony\Component\Console\Input\InputOption
的用法示例。
在下文中一共展示了InputOption::__construct方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: __construct
public function __construct($name, $shortcut = null, $mode = null, $description = '', $default = null, $question = null)
{
parent::__construct($name, $shortcut, $mode, $description, $default);
$this->name = $name;
$this->question = $question;
$this->default = $default;
}
示例2: __construct
/**
* Constructor.
*
* @param string $name The option name
* @param string $description A description text
*
* @api
*/
public function __construct($name, $description = '')
{
if ('--' === substr($name, 0, 2)) {
$name = substr($name, 2);
}
$this->name = $name;
$this->description = $description;
parent::__construct($name, null, InputOption::VALUE_OPTIONAL, $description, null);
}
示例3: __construct
public function __construct($config_path, $name, $shortcut = null, $mode = null, $description = '', $default = null, $required = true, $callback = null)
{
parent::__construct($name, $shortcut, $mode, $description, $default);
if (empty($config_path)) {
throw new \InvalidArgumentException(sprintf('The config option "%s" is not mapped to a configuration parameter.', $name));
}
$this->config_path = $config_path;
$this->required = $required;
$this->callback = $callback;
}
示例4: __construct
/**
* Constructor
*
* @param string $name
* @param string $frontendType
* @param int $mode
* @param string $configPath
* @param string $description
* @param string|array|null $defaultValue
* @param string|array|null $shortcut
*/
public function __construct($name, $frontendType, $mode, $configPath, $description = '', $defaultValue = null, $shortcut = null)
{
$this->frontendType = $frontendType;
$this->configPath = $configPath;
parent::__construct($name, $shortcut, $mode, $description, $defaultValue);
}