This commit is contained in:
2023-12-18 22:23:17 +08:00
parent 7c0ab8c639
commit a51b666303
13 changed files with 67 additions and 141 deletions
+8 -7
View File
@@ -5,12 +5,14 @@ namespace Kiri\Router\Annotate;
use Kiri;
use Kiri\Router\Constrict\RequestMethod;
use Kiri\Router\Interface\InjectRouteInterface;
use Kiri\Router\Router;
use ReflectionClass;
use Kiri\Di\Interface\InjectMethodInterface;
/**
*
*/
#[\Attribute(\Attribute::TARGET_METHOD | \Attribute::IS_REPEATABLE)]
class Put extends AbstractRequestMethod implements InjectRouteInterface
class Put extends AbstractRequestMethod implements InjectMethodInterface
{
@@ -24,14 +26,13 @@ class Put extends AbstractRequestMethod implements InjectRouteInterface
/**
* @param object $class
* @param string $class
* @param string $method
* @return void
* @throws
*/
public function dispatch(ReflectionClass $class, string $method): void
public function dispatch(string $class, string $method): void
{
$controller = Kiri::getDi()->makeReflection($class);
$controller = Kiri::getDi()->get($class);
// TODO: Implement dispatch() method.
$path = '/' . ltrim($this->path, '/');
if (!empty($this->version)) {