當前位置: 首頁>>代碼示例>>PHP>>正文


PHP OptionsResolver::addAllowedTypes方法代碼示例

本文整理匯總了PHP中Symfony\Component\OptionsResolver\OptionsResolver::addAllowedTypes方法的典型用法代碼示例。如果您正苦於以下問題:PHP OptionsResolver::addAllowedTypes方法的具體用法?PHP OptionsResolver::addAllowedTypes怎麽用?PHP OptionsResolver::addAllowedTypes使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Symfony\Component\OptionsResolver\OptionsResolver的用法示例。


在下文中一共展示了OptionsResolver::addAllowedTypes方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: configureOptions

 public function configureOptions(OptionsResolver $resolver)
 {
     $resolver->setDefined(['customFormModel', 'territoryRepository', 'projectSettings']);
     $resolver->setRequired(['customFormModel', 'territoryRepository', 'projectSettings']);
     $resolver->addAllowedTypes('customFormModel', CustomFormModelInterface::class);
     $resolver->addAllowedTypes('projectSettings', ProjectSettings::class);
 }
開發者ID:zyxist,項目名稱:cantiga,代碼行數:7,代碼來源:AreaProfileForm.php

示例2: getConfigurableOptions

 /**
  * @return OptionsResolver
  */
 public function getConfigurableOptions()
 {
     $resolver = new OptionsResolver();
     $resolver->setDefaults(['triggered_by' => [], 'ignore_patterns' => []]);
     $resolver->addAllowedTypes('triggered_by', ['array']);
     $resolver->addAllowedTypes('ignore_patterns', ['array']);
     return $resolver;
 }
開發者ID:phpro,項目名稱:grumphp,代碼行數:11,代碼來源:AbstractParserTask.php

示例3: configureOptions

 public function configureOptions(OptionsResolver $resolver)
 {
     $resolver->setRequired(['isORM', 'isEdit', 'isFilter', 'user']);
     $resolver->addAllowedTypes('isORM', 'boolean');
     $resolver->addAllowedTypes('isEdit', 'boolean');
     $resolver->addAllowedTypes('isFilter', 'boolean');
     $resolver->addAllowedTypes('user', [UserInterface::class, 'NULL']);
 }
開發者ID:phpink,項目名稱:nami-core-bundle,代碼行數:8,代碼來源:BaseType.php

示例4: getConfigurableOptions

 /**
  * @return OptionsResolver
  */
 public function getConfigurableOptions()
 {
     $resolver = new OptionsResolver();
     $resolver->setDefaults(array('config_file' => null, 'stop_on_failure' => false));
     $resolver->addAllowedTypes('config_file', array('null', 'string'));
     $resolver->addAllowedTypes('stop_on_failure', array('bool'));
     return $resolver;
 }
開發者ID:aaa2000,項目名稱:grumphp,代碼行數:11,代碼來源:Phpspec.php

示例5: getConfigurableOptions

 /**
  * @return OptionsResolver
  */
 public function getConfigurableOptions()
 {
     $resolver = new OptionsResolver();
     $resolver->setDefaults(['keywords' => [], 'triggered_by' => ['php']]);
     $resolver->addAllowedTypes('keywords', ['array']);
     $resolver->addAllowedTypes('triggered_by', ['array']);
     return $resolver;
 }
開發者ID:phpro,項目名稱:grumphp,代碼行數:11,代碼來源:Blacklist.php

示例6: getConfigurableOptions

 /**
  * @return OptionsResolver
  */
 public function getConfigurableOptions()
 {
     $resolver = new OptionsResolver();
     $resolver->setDefaults(array('keywords' => array(), 'triggered_by' => array('php')));
     $resolver->addAllowedTypes('keywords', array('array'));
     $resolver->addAllowedTypes('triggered_by', array('array'));
     return $resolver;
 }
開發者ID:llaville,項目名稱:grumphp,代碼行數:11,代碼來源:Blacklist.php

示例7: getConfigurableOptions

 /**
  * @return OptionsResolver
  */
 public function getConfigurableOptions()
 {
     $resolver = new OptionsResolver();
     $resolver->setDefaults(['gulp_file' => null, 'task' => null, 'triggered_by' => ['js', 'jsx', 'coffee', 'ts', 'less', 'sass', 'scss']]);
     $resolver->addAllowedTypes('gulp_file', ['null', 'string']);
     $resolver->addAllowedTypes('task', ['null', 'string']);
     $resolver->addAllowedTypes('triggered_by', ['array']);
     return $resolver;
 }
開發者ID:phpro,項目名稱:grumphp,代碼行數:12,代碼來源:Gulp.php

示例8: getConfigurableOptions

 /**
  * @return OptionsResolver
  */
 public function getConfigurableOptions()
 {
     $resolver = new OptionsResolver();
     $resolver->setDefaults(['exclude' => [], 'ruleset' => ['cleancode', 'codesize', 'naming'], 'triggered_by' => ['php']]);
     $resolver->addAllowedTypes('exclude', ['array']);
     $resolver->addAllowedTypes('ruleset', ['array']);
     $resolver->addAllowedTypes('triggered_by', ['array']);
     return $resolver;
 }
開發者ID:phpro,項目名稱:grumphp,代碼行數:12,代碼來源:PhpMd.php

示例9: getConfigurableOptions

 /**
  * @return OptionsResolver
  */
 public function getConfigurableOptions()
 {
     $resolver = new OptionsResolver();
     $resolver->setDefaults(array('grunt_file' => null, 'task' => null, 'triggered_by' => array('js', 'jsx', 'coffee', 'ts', 'less', 'sass', 'scss')));
     $resolver->addAllowedTypes('grunt_file', array('null', 'string'));
     $resolver->addAllowedTypes('task', array('null', 'string'));
     $resolver->addAllowedTypes('triggered_by', array('array'));
     return $resolver;
 }
開發者ID:Big-Shark,項目名稱:grumphp,代碼行數:12,代碼來源:Grunt.php

示例10: getConfigurableOptions

 /**
  * @return OptionsResolver
  */
 public function getConfigurableOptions()
 {
     $resolver = new OptionsResolver();
     $resolver->setDefaults(array('directory' => 'features', 'align' => null));
     $resolver->addAllowedTypes('directory', array('string'));
     $resolver->addAllowedTypes('align', array('null', 'string'));
     $resolver->addAllowedValues('align', array(null, 'left', 'right'));
     return $resolver;
 }
開發者ID:Big-Shark,項目名稱:grumphp,代碼行數:12,代碼來源:Gherkin.php

示例11: getConfigurableOptions

 /**
  * @return OptionsResolver
  */
 public function getConfigurableOptions()
 {
     $resolver = new OptionsResolver();
     $resolver->setDefaults(['script' => null, 'triggered_by' => ['js', 'jsx', 'coffee', 'ts', 'less', 'sass', 'scss'], 'working_directory' => './']);
     $resolver->addAllowedTypes('script', ['string']);
     $resolver->addAllowedTypes('triggered_by', ['array']);
     $resolver->addAllowedTypes('working_directory', ['string']);
     return $resolver;
 }
開發者ID:phpro,項目名稱:grumphp,代碼行數:12,代碼來源:NpmScript.php

示例12: getConfigurableOptions

 /**
  * @return OptionsResolver
  */
 public function getConfigurableOptions()
 {
     $resolver = new OptionsResolver();
     $resolver->setDefaults(['config_file' => null, 'group' => [], 'always_execute' => false]);
     $resolver->addAllowedTypes('config_file', ['null', 'string']);
     $resolver->addAllowedTypes('group', ['array']);
     $resolver->addAllowedTypes('always_execute', ['bool']);
     return $resolver;
 }
開發者ID:phpro,項目名稱:grumphp,代碼行數:12,代碼來源:Phpunit.php

示例13: getConfigurableOptions

 /**
  * @return OptionsResolver
  */
 public function getConfigurableOptions()
 {
     $resolver = new OptionsResolver();
     $resolver->setDefaults(array('triggered_by' => array('php'), 'build_file' => null, 'task' => null));
     $resolver->addAllowedTypes('triggered_by', array('array'));
     $resolver->addAllowedTypes('build_file', array('null', 'string'));
     $resolver->addAllowedTypes('task', array('null', 'string'));
     return $resolver;
 }
開發者ID:Big-Shark,項目名稱:grumphp,代碼行數:12,代碼來源:Ant.php

示例14: getConfigurableOptions

 /**
  * @return OptionsResolver
  */
 public function getConfigurableOptions()
 {
     $resolver = new OptionsResolver();
     $resolver->setDefaults(['skip_mapping' => false, 'skip_sync' => false, 'triggered_by' => ['php', 'xml', 'yml']]);
     $resolver->addAllowedTypes('skip_mapping', ['bool']);
     $resolver->addAllowedTypes('skip_sync', ['bool']);
     $resolver->addAllowedTypes('triggered_by', ['array']);
     return $resolver;
 }
開發者ID:phpro,項目名稱:grumphp,代碼行數:12,代碼來源:DoctrineOrm.php

示例15: getConfigurableOptions

 /**
  * @return OptionsResolver
  */
 public function getConfigurableOptions()
 {
     $resolver = new OptionsResolver();
     $resolver->setDefaults(['working_directory' => null, 'script' => null, 'triggered_by' => ['php', 'phtml']]);
     $resolver->addAllowedTypes('working_directory', ['null', 'string']);
     $resolver->addAllowedTypes('script', ['string']);
     $resolver->addAllowedTypes('triggered_by', ['array']);
     return $resolver;
 }
開發者ID:phpro,項目名稱:grumphp,代碼行數:12,代碼來源:ComposerScript.php


注:本文中的Symfony\Component\OptionsResolver\OptionsResolver::addAllowedTypes方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。