变更
This commit is contained in:
@@ -19,7 +19,7 @@ class Put extends AbstractRequestMethod implements InjectRouteInterface
|
||||
/**
|
||||
* @param string $path
|
||||
*/
|
||||
public function __construct(readonly public string $path)
|
||||
public function __construct(readonly public string $path, readonly public string $version = 'v1')
|
||||
{
|
||||
}
|
||||
|
||||
@@ -34,7 +34,9 @@ class Put extends AbstractRequestMethod implements InjectRouteInterface
|
||||
public function dispatch(object $class, string $method): void
|
||||
{
|
||||
// TODO: Implement dispatch() method.
|
||||
Router::addRoute(RequestMethod::REQUEST_PUT, $this->path, [$class, $method]);
|
||||
$path = $this->version . '/' . ltrim($this->path, '/');
|
||||
|
||||
Router::addRoute(RequestMethod::REQUEST_PUT, $path, [$class, $method]);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user