diff --git a/src/Annotate/Delete.php b/src/Annotate/Delete.php index f61e4da..a7a97ff 100644 --- a/src/Annotate/Delete.php +++ b/src/Annotate/Delete.php @@ -33,7 +33,7 @@ class Delete extends AbstractRequestMethod implements InjectRouteInterface public function dispatch(object $class, string $method): void { // TODO: Implement dispatch() method. - $path = $this->version . '/' . ltrim($this->path, '/'); + $path = '/' . ltrim($this->path, '/'); Router::addRoute(RequestMethod::REQUEST_DELETE, $path, [$class, $method]); } diff --git a/src/Annotate/Get.php b/src/Annotate/Get.php index 48b4ff2..afad291 100644 --- a/src/Annotate/Get.php +++ b/src/Annotate/Get.php @@ -33,7 +33,7 @@ class Get extends AbstractRequestMethod implements InjectRouteInterface public function dispatch(object $class, string $method): void { // TODO: Implement dispatch() method. - $path = $this->version . '/' . ltrim($this->path, '/'); + $path = '/' . ltrim($this->path, '/'); Router::addRoute(RequestMethod::REQUEST_GET, $path, [$class, $method]); } diff --git a/src/Annotate/Head.php b/src/Annotate/Head.php index bc653ba..a8299a7 100644 --- a/src/Annotate/Head.php +++ b/src/Annotate/Head.php @@ -34,7 +34,7 @@ class Head extends AbstractRequestMethod implements InjectRouteInterface public function dispatch(object $class, string $method): void { // TODO: Implement dispatch() method. - $path = $this->version . '/' . ltrim($this->path, '/'); + $path = '/' . ltrim($this->path, '/'); Router::addRoute(RequestMethod::REQUEST_HEAD, $path, [$class, $method]); } diff --git a/src/Annotate/Options.php b/src/Annotate/Options.php index 903efeb..b19f774 100644 --- a/src/Annotate/Options.php +++ b/src/Annotate/Options.php @@ -34,7 +34,7 @@ class Options extends AbstractRequestMethod implements InjectRouteInterface public function dispatch(object $class, string $method): void { // TODO: Implement dispatch() method. - $path = $this->version . '/' . ltrim($this->path, '/'); + $path = '/' . ltrim($this->path, '/'); Router::addRoute(RequestMethod::REQUEST_OPTIONS, $path, [$class, $method]); } diff --git a/src/Annotate/Post.php b/src/Annotate/Post.php index bb059e4..31bd9e3 100644 --- a/src/Annotate/Post.php +++ b/src/Annotate/Post.php @@ -33,7 +33,7 @@ class Post extends AbstractRequestMethod implements InjectRouteInterface public function dispatch(object $class, string $method): void { // TODO: Implement dispatch() method. - $path = $this->version . '/' . ltrim($this->path, '/'); + $path = '/' . ltrim($this->path, '/'); Router::addRoute(RequestMethod::REQUEST_POST, $path, [$class, $method]); } diff --git a/src/Annotate/Put.php b/src/Annotate/Put.php index 4bf5360..691aedf 100644 --- a/src/Annotate/Put.php +++ b/src/Annotate/Put.php @@ -34,7 +34,7 @@ class Put extends AbstractRequestMethod implements InjectRouteInterface public function dispatch(object $class, string $method): void { // TODO: Implement dispatch() method. - $path = $this->version . '/' . ltrim($this->path, '/'); + $path = '/' . ltrim($this->path, '/'); Router::addRoute(RequestMethod::REQUEST_PUT, $path, [$class, $method]); } diff --git a/src/Annotate/Route.php b/src/Annotate/Route.php index efac4fa..4e4b940 100644 --- a/src/Annotate/Route.php +++ b/src/Annotate/Route.php @@ -30,7 +30,7 @@ class Route extends AbstractRequestMethod implements InjectRouteInterface public function dispatch(object $class, string $method): void { // TODO: Implement dispatch() method. - $path = $this->version . '/' . ltrim($this->path, '/'); + $path = '/' . ltrim($this->path, '/'); Router::addRoute([$this->method], $path, [$class, $method]); } diff --git a/src/Request.php b/src/Request.php index 3bbf1d2..cbd92e3 100644 --- a/src/Request.php +++ b/src/Request.php @@ -65,6 +65,17 @@ class Request implements ServerRequestInterface } + /** + * @param string $name + * @return mixed + */ + public function __get(string $name): mixed + { + // TODO: Implement __get() method. + return $this->__call__('get' . ucfirst($name)); + } + + /** * Retrieves the HTTP protocol version as a string. *