예제 #1
0
 public function testHasFilter()
 {
     $route = new Route('/', function () {
     });
     $this->assertFalse($route->hasFilter('before.age'));
     $route->addFilter('before.age');
     $this->assertTrue($route->hasFilter('before.age'));
 }
예제 #2
0
 /**
  * 
  * @param Route $route
  * @return null | mixed
  * */
 public function filterByRoute(Route $route)
 {
     return $this->filter(function ($filter) use($route) {
         return $route->hasFilter($filter->getName());
     });
 }