/** * Checks if the incoming request method matches against the * allowed methods in the `Route` object. * * @param ServerRequestInterface $request The incoming request. * @param Route $route The Route to match against. * @return boolean `true` if method matched, `false` otherwise. */ public function __invoke(ServerRequestInterface $request, Route $route) { return in_array($request->getMethod(), $route->getMethods()); }