变更
This commit is contained in:
@@ -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]);
|
||||
}
|
||||
|
||||
@@ -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]);
|
||||
}
|
||||
|
||||
@@ -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]);
|
||||
}
|
||||
|
||||
@@ -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]);
|
||||
}
|
||||
|
||||
@@ -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]);
|
||||
}
|
||||
|
||||
@@ -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]);
|
||||
}
|
||||
|
||||
@@ -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]);
|
||||
}
|
||||
|
||||
@@ -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.
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user