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