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


PHP InputDefinition::__construct方法代码示例

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


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

示例1: __construct

 /**
  * Define input definition for peridot
  */
 public function __construct()
 {
     parent::__construct([]);
     $this->addArgument(new InputArgument('path', InputArgument::OPTIONAL, 'The path to a directory or file containing specs'));
     $this->addOption(new InputOption('grep', 'g', InputOption::VALUE_REQUIRED, 'Run tests matching <pattern> <comment>(default: *.spec.php)</comment>'));
     $this->addOption(new InputOption('no-colors', 'C', InputOption::VALUE_NONE, 'Disable output colors'));
     $this->addOption(new InputOption('reporter', 'r', InputOption::VALUE_REQUIRED, 'Select which reporter to use <comment>(default: spec)</comment>'));
     $this->addOption(new InputOption('bail', 'b', InputOption::VALUE_NONE, 'Stop on failure'));
     $this->addOption(new InputOption('configuration', 'c', InputOption::VALUE_REQUIRED, 'A php file containing peridot configuration'));
     $this->addOption(new InputOption('reporters', null, InputOption::VALUE_NONE, 'List all available reporters'));
     $this->addOption(new InputOption('--version', '-V', InputOption::VALUE_NONE, 'Display the Peridot version number'));
     $this->addOption(new InputOption('--help', '-h', InputOption::VALUE_NONE, 'Display this help message.'));
 }
开发者ID:peridot-php,项目名称:peridot-cli,代码行数:16,代码来源:InputDefinition.php

示例2: __construct

 /**
  * Creates a new adapter.
  *
  * @param ArgsFormat $format The adapted format.
  */
 public function __construct(ArgsFormat $format)
 {
     parent::__construct();
     $i = 1;
     foreach ($format->getCommandNames() as $commandName) {
         do {
             $argName = 'cmd' . $i++;
         } while ($format->hasArgument($argName));
         $this->addArgument($argument = $this->adaptCommandName($commandName, $argName));
         $this->commandNames[$argument->getName()] = $commandName;
     }
     foreach ($format->getCommandOptions() as $commandOption) {
         $this->addOption($this->adaptCommandOption($commandOption));
     }
     foreach ($format->getOptions() as $option) {
         $this->addOption($this->adaptOption($option));
     }
     foreach ($format->getArguments() as $argument) {
         $this->addArgument($this->adaptArgument($argument));
     }
 }
开发者ID:webmozart,项目名称:console,代码行数:26,代码来源:ArgsFormatInputDefinition.php

示例3: __construct

 /**
  * Initializing and building parent symfony/console InputDefinition
  */
 public function __construct()
 {
     parent::__construct(array(new InputOption("file", "f", InputOption::VALUE_IS_ARRAY | InputOption::VALUE_REQUIRED), new InputOption("directory", "d", InputOption::VALUE_REQUIRED), new InputOption("verbose", "v", InputOption::VALUE_NONE), new InputOption("modified", null, InputOption::VALUE_NONE), new InputOption("pre-commit", null, InputOption::VALUE_NONE), new InputOption("diff", null, InputOption::VALUE_REQUIRED)));
 }
开发者ID:clorichel,项目名称:SCQAT,代码行数:7,代码来源:Definition.php

示例4: __construct

 /**
  * Constructor
  */
 public function __construct()
 {
     $definition = [new InputOption('root', 'r', 2, 'The application root.'), new InputOption('schema_path', 'sp', 2, 'Path to schema files (relative to root).'), new InputOption('schema_filename', 'sf', 4, 'Schema filename to be used as generation source.'), new InputOption('target_path', 'tp', 2, 'Path to save generated files (relative to root)'), new InputOption('template_path', 't', 2, 'Templates for generated files.'), new InputOption('generator_class', 'gc', 2, 'Fully namespaced generator class.'), new InputOption('converter_class', 'cc', 2, 'Fully namespaced converter class.'), new InputOption('bundle', 'b', 2, 'Name of loaded bundles(s) to generate, ex: "all" or "System" or "System:Content".'), new InputOption('model', 'm', 2, 'Name of loaded model(s) to generate, ex: "all" or "User" or "User:Role".'), new InputOption('subset', 's', 2, 'Function(s) to run, ex: "all" or "model:controller".'), new InputOption('extra', 'e', 2, 'Name of extra functions to run that are not specific to models, ex: "all".', "none"), new InputOption('prefix', 'p', 2, 'Name of routing prefix, ex: "Admin".'), new InputOption('namespace', 'n', 4, 'Namespace prefix.')];
     parent::__construct($definition);
 }
开发者ID:mattcrowe,项目名称:ginny,代码行数:8,代码来源:GinnyDefinition.php


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