match() 공개 메소드

public match ( Request $request, Element $config ) : boolean
$request Symfony\Component\HttpFoundation\Request
$config Coduo\TuTu\Config\Element
리턴 boolean
예제 #1
0
파일: Resolver.php 프로젝트: coduo/tutu
 /**
  * @param Request $request
  * @return Element|null
  */
 public function resolveConfigElement(Request $request)
 {
     foreach ($this->configs as $config) {
         if ($this->matchingPolicy->match($request, $config)) {
             return $config;
         }
     }
     return null;
 }
예제 #2
0
파일: ResolverSpec.php 프로젝트: coduo/tutu
 function it_return_null_when_matching_policy_cant_match_request(MatchingPolicy $matchingPolicy)
 {
     $request = Request::create('/foo/index', 'POST');
     $matchingPolicy->match($request, Argument::type('Coduo\\TuTu\\Config\\Element'))->willReturn(false);
     $this->resolveConfigElement($request)->shouldReturn(null);
 }