This commit is contained in:
2023-12-12 15:35:35 +08:00
parent 968d572e84
commit 65d41ab868
29 changed files with 646 additions and 701 deletions
+15 -16
View File
@@ -19,26 +19,25 @@ class Put extends AbstractRequestMethod implements InjectRouteInterface
* @param string $path
* @param string $version
*/
public function __construct(readonly public string $path, readonly public string $version = '')
{
}
public function __construct(readonly public string $path, readonly public string $version = '')
{
}
/**
* @param object $class
* @param string $method
* @return void
* @throws ReflectionException
* @throws Exception
*/
public function dispatch(object $class, string $method): void
{
// TODO: Implement dispatch() method.
$path = '/' . ltrim($this->path, '/');
/**
* @param object $class
* @param string $method
* @return void
* @throws
*/
public function dispatch(object $class, string $method): void
{
// TODO: Implement dispatch() method.
$path = '/' . ltrim($this->path, '/');
if (!empty($this->version)) {
$path = '/' . trim($this->version) . $path;
}
Router::addRoute(RequestMethod::REQUEST_PUT, $path, [$class, $method]);
}
Router::addRoute(RequestMethod::REQUEST_PUT, $path, [$class, $method]);
}
}