request = $request; if (is_null($matches)) { $matches = array(); } $this->matches = $matches; $this->response = new Response(); $this->buildResponse(); } protected function buildResponse() { switch ($this->request->method) { case 'GET': $this->get(); break; case 'HEAD': $this->head(); break; case 'POST': $this->post(); break; case 'PUT': $this->put(); break; case 'DELETE': $this->delete(); break; case 'PATCH': $this->patch(); break; case 'OPTIONS': $this->options(); break; } } public function getResponse() { return $this->response; } protected function get() { $this->response->statusCode = 405; } protected function head() { $this->response->statusCode = 405; } protected function post() { $this->response->statusCode = 405; } protected function put() { $this->response->statusCode = 405; } protected function patch() { $this->response->statusCode = 405; } protected function options() { $this->response->statusCode = 405; } } ?>