context = $context; } public function match($rawPathinfo) { $allow = array(); $pathinfo = rawurldecode($rawPathinfo); $context = $this->context; $request = $this->request ?: $this->createRequest($pathinfo); if (0 === strpos($pathinfo, '/admin/module')) { // admin.recaptcha.config if ('/admin/module/ReCaptcha' === $pathinfo) { return array ( '_controller' => 'ReCaptcha\\Controller\\ConfigurationController::viewAction', '_route' => 'admin.recaptcha.config',); } // admin.recaptcha.config.save if ('/admin/module/recaptcha/configuration' === $pathinfo) { if ($this->context->getMethod() != 'POST') { $allow[] = 'POST'; goto not_adminrecaptchaconfigsave; } return array ( '_controller' => 'ReCaptcha\\Controller\\ConfigurationController::saveAction', '_route' => 'admin.recaptcha.config.save',); } not_adminrecaptchaconfigsave: } throw 0 < count($allow) ? new MethodNotAllowedException(array_unique($allow)) : new ResourceNotFoundException(); } }