Encapsulates the route, the callback to execute, and the methods it will respond to.
Esempio n. 1
0
File: App.php Progetto: phly/phlyty
 /**
  * Determine what methods a route responds to
  *
  * @param  Route $route
  * @param  int   $index
  */
 protected function registerRouteMethods(Route $route, $index)
 {
     foreach ($route->respondsTo() as $method) {
         if (!isset($this->routesByMethod[$method])) {
             $this->routesByMethod[$method] = [];
         }
         $this->routesByMethod[$method][$index] = $route;
     }
 }
Esempio n. 2
0
 public function testCanSpecifyAdditionalMethodTypesToRespondTo()
 {
     Route::allowMethod(__FUNCTION__);
     $map = $this->app->map('/:controller', 'bogus-callback');
     $map->via(__FUNCTION__);
     $this->assertTrue($map->respondsTo(__FUNCTION__));
 }