qqq
This commit is contained in:
@@ -20,7 +20,7 @@ class Delete extends AbstractRequestMethod implements InjectRouteInterface
|
||||
* @param string $version
|
||||
* @param bool $enableOption
|
||||
*/
|
||||
public function __construct(readonly public string $path, readonly public string $version = 'v1', readonly public bool $enableOption = true)
|
||||
public function __construct(readonly public string $path, readonly public string $version = 'v1')
|
||||
{
|
||||
}
|
||||
|
||||
@@ -38,10 +38,6 @@ class Delete extends AbstractRequestMethod implements InjectRouteInterface
|
||||
$path = '/' . ltrim($this->path, '/');
|
||||
|
||||
Router::addRoute(RequestMethod::REQUEST_DELETE, $path, [$class, $method]);
|
||||
if ($this->enableOption) {
|
||||
$options = [di(OptionsController::class), 'index'];
|
||||
Router::addRoute([RequestMethod::REQUEST_OPTIONS], $path, $options);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -20,7 +20,7 @@ class Get extends AbstractRequestMethod implements InjectRouteInterface
|
||||
* @param string $version
|
||||
* @param bool $enableOption
|
||||
*/
|
||||
public function __construct(readonly public string $path, readonly public string $version = 'v1', readonly public bool $enableOption = true)
|
||||
public function __construct(readonly public string $path, readonly public string $version = 'v1')
|
||||
{
|
||||
}
|
||||
|
||||
@@ -38,10 +38,6 @@ class Get extends AbstractRequestMethod implements InjectRouteInterface
|
||||
$path = '/' . ltrim($this->path, '/');
|
||||
|
||||
Router::addRoute(RequestMethod::REQUEST_GET, $path, [$class, $method]);
|
||||
if ($this->enableOption) {
|
||||
$options = [di(OptionsController::class), 'index'];
|
||||
Router::addRoute([RequestMethod::REQUEST_OPTIONS], $path, $options);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -20,7 +20,7 @@ class Post extends AbstractRequestMethod implements InjectRouteInterface
|
||||
* @param string $version
|
||||
* @param bool $enableOption
|
||||
*/
|
||||
public function __construct(readonly public string $path, readonly public string $version = 'v1', readonly public bool $enableOption = true)
|
||||
public function __construct(readonly public string $path, readonly public string $version = 'v1')
|
||||
{
|
||||
}
|
||||
|
||||
@@ -38,10 +38,6 @@ class Post extends AbstractRequestMethod implements InjectRouteInterface
|
||||
$path = '/' . ltrim($this->path, '/');
|
||||
|
||||
Router::addRoute(RequestMethod::REQUEST_POST, $path, [$class, $method]);
|
||||
if ($this->enableOption) {
|
||||
$options = [di(OptionsController::class), 'index'];
|
||||
Router::addRoute([RequestMethod::REQUEST_OPTIONS], $path, $options);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -20,7 +20,7 @@ class Put extends AbstractRequestMethod implements InjectRouteInterface
|
||||
* @param string $version
|
||||
* @param bool $enableOption
|
||||
*/
|
||||
public function __construct(readonly public string $path, readonly public string $version = 'v1', readonly public bool $enableOption = true)
|
||||
public function __construct(readonly public string $path, readonly public string $version = 'v1')
|
||||
{
|
||||
}
|
||||
|
||||
@@ -38,10 +38,6 @@ class Put extends AbstractRequestMethod implements InjectRouteInterface
|
||||
$path = '/' . ltrim($this->path, '/');
|
||||
|
||||
Router::addRoute(RequestMethod::REQUEST_PUT, $path, [$class, $method]);
|
||||
if ($this->enableOption) {
|
||||
$options = [di(OptionsController::class), 'index'];
|
||||
Router::addRoute([RequestMethod::REQUEST_OPTIONS], $path, $options);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user