本文整理汇总了PHP中Symfony\Component\OptionsResolver\OptionsResolver::remove方法的典型用法代码示例。如果您正苦于以下问题:PHP OptionsResolver::remove方法的具体用法?PHP OptionsResolver::remove怎么用?PHP OptionsResolver::remove使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Symfony\Component\OptionsResolver\OptionsResolver
的用法示例。
在下文中一共展示了OptionsResolver::remove方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: remove
/**
* {@inheritDoc}
*/
public function remove($optionNames)
{
parent::remove($optionNames);
/* This must be done after the parent to ensure that the parent's locked state is enforced. */
foreach ((array) $optionNames as $option) {
unset($this->casts[$option]);
}
return $this;
}
示例2: testRemoveOptionAndNormalizer
public function testRemoveOptionAndNormalizer()
{
$this->options->set('foo1', 'bar');
$this->options->setNormalizer('foo1', function (Options $options) {
return '';
});
$this->options->set('foo2', 'bar');
$this->options->setNormalizer('foo2', function (Options $options) {
return '';
});
$this->options->remove('foo2');
$this->assertEquals(array('foo1' => ''), $this->options->resolve());
}
示例3: testRemoveUnknownOptionIgnored
public function testRemoveUnknownOptionIgnored()
{
$this->assertNotNull($this->resolver->remove('foo'));
}