本文整理汇总了PHP中Factory::filter方法的典型用法代码示例。如果您正苦于以下问题:PHP Factory::filter方法的具体用法?PHP Factory::filter怎么用?PHP Factory::filter使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Factory
的用法示例。
在下文中一共展示了Factory::filter方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: having
/**
* @return Filter
*/
public function having()
{
if (!isset($this->_having)) {
$this->_having = Factory::filter($this);
}
return $this->_having;
}
示例2: testShouldUseOneOfFilterWhenInputHasContainsTheWordOr
public function testShouldUseOneOfFilterWhenInputHasContainsTheWordOr()
{
$expectedFilter = new Filter\OneOf(array(new Filter\GreaterThan(42), new Filter\EqualTo(42)));
$factory = new Factory();
$actualFilter = $factory->filter('greaterThanOrEqualTo', array(42));
$this->assertEquals($expectedFilter, $actualFilter);
}
示例3: filter
/**
* @return Filter
*/
public function filter()
{
if (!isset($this->_filter)) {
$this->_filter = Factory::filter($this);
}
return $this->_filter;
}
示例4: testShouldDefineParamsWhenFilterNameIsACallback
public function testShouldDefineParamsWhenFilterNameIsACallback()
{
$factory = new Factory();
$callback = $factory->filter('json_encode', array(JSON_ERROR_SYNTAX));
$this->assertSame(array(JSON_ERROR_SYNTAX), $callback->getCallbackParams());
}