コード例 #1
0
 public function classSetUp()
 {
     $this->filter = new FilterChain();
     $this->filter->andFilter(new CompositeFilter([new GetFilter(), new HasFilter(), new IsFilter()], CompositeFilter::TYPE_OR));
     $this->filter->andFilter(new OptionalParametersFilter());
     $this->object = new CompositeFilterObject();
 }
コード例 #2
0
 /**
  * Constructor
  */
 public function __construct()
 {
     parent::__construct();
     $this->filterChain = new FilterChain();
     $this->filterChain->andFilter(new CompositeFilter([new GetFilter(), new IsFilter(), new HasFilter()], CompositeFilter::TYPE_OR));
     $this->filterChain->andFilter(new OptionalParametersFilter());
 }
コード例 #3
0
ファイル: FilterChainTest.php プロジェクト: psfpro/hydrator
 public function testAndFilter()
 {
     $filterContainer = new FilterChain();
     $filterContainer->andFilter(new ExcludeMethodsFilter(['getBar', 'getBaz']));
     $filterContainer->andFilter(new GetFilter());
     $this->assertFalse($filterContainer->accept('getBar'), 'Rejected because of the ExcludeMethods');
     $this->assertFalse($filterContainer->accept('isFoo'), 'Rejected because of the GetFilter');
     $this->assertTrue($filterContainer->accept('getFoo'));
 }