original_string: protected function findRoute(Request $request)
      {
          if (! in_array($request->method(), array('GET', 'HEAD', 'OPTIONS'))) {
              return;
          }
  
          $uri = $request->path();
  
          foreach ($this->routes as $pattern => $callback) {
              if (preg_match('#^' .$pattern .'$#s', $uri, $matches)) {
                  return array($callback, array_slice($matches, 1));
              }
          }
      }
code: protected function findRoute(Request $request)
      {
          if (! in_array($request->method(), array('GET', 'HEAD', 'OPTIONS'))) {
              return;
          }
  
          $uri = $request->path();
  
          foreach ($this->routes as $pattern => $callback) {
              if (preg_match('#^' .$pattern .'$#s', $uri, $matches)) {
                  return array($callback, array_slice($matches, 1));
              }
          }
      }
code_tokens: protected function findRoute ( Request $ request ) { if ( ! in_array ( $ request -> method ( ) , array ( 'GET' , 'HEAD' , 'OPTIONS' ) ) ) { return ; } $ uri = $ request -> path ( ) ; foreach ( $ this -> routes as $ pattern => $ callback ) { if ( preg_match ( '#^' . $ pattern . '$#s' , $ uri , $ matches ) ) { return array ( $ callback , array_slice ( $ matches , 1 ) ) ; } } }
docstring: Dispatch an URI and return the associated file path.
  
  @param  string  $uri
  @return string|null
docstring_tokens: Dispatch an URI and return the associated file path .