eee
This commit is contained in:
@@ -3,14 +3,12 @@ declare(strict_types=1);
|
||||
|
||||
namespace Kiri\Router\Annotate;
|
||||
|
||||
use Kiri\Di\Interface\InjectMethodInterface;
|
||||
use Kiri\Router\Constrict\RequestMethod;
|
||||
use Kiri\Router\Interface\InjectRouteInterface;
|
||||
use Kiri\Router\Router;
|
||||
use ReflectionClass;
|
||||
use ReflectionException;
|
||||
|
||||
#[\Attribute(\Attribute::TARGET_METHOD | \Attribute::IS_REPEATABLE)]
|
||||
class Delete extends AbstractRequestMethod implements InjectRouteInterface
|
||||
class Delete extends AbstractRequestMethod implements InjectMethodInterface
|
||||
{
|
||||
|
||||
|
||||
@@ -24,14 +22,13 @@ class Delete extends AbstractRequestMethod implements InjectRouteInterface
|
||||
|
||||
|
||||
/**
|
||||
* @param ReflectionClass $class
|
||||
* @param string $class
|
||||
* @param string $method
|
||||
* @return void
|
||||
* @throws ReflectionException
|
||||
*/
|
||||
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, '/');
|
||||
|
||||
+5
-10
@@ -3,16 +3,12 @@ declare(strict_types=1);
|
||||
|
||||
namespace Kiri\Router\Annotate;
|
||||
|
||||
use Exception;
|
||||
use Kiri\Di\Interface\InjectMethodInterface;
|
||||
use Kiri\Router\Constrict\RequestMethod;
|
||||
use Kiri\Router\Interface\InjectRouteInterface;
|
||||
use Kiri\Router\OptionsController;
|
||||
use Kiri\Router\Router;
|
||||
use ReflectionClass;
|
||||
use ReflectionException;
|
||||
|
||||
#[\Attribute(\Attribute::TARGET_METHOD | \Attribute::IS_REPEATABLE)]
|
||||
class Get extends AbstractRequestMethod implements InjectRouteInterface
|
||||
class Get extends AbstractRequestMethod implements InjectMethodInterface
|
||||
{
|
||||
|
||||
|
||||
@@ -26,14 +22,13 @@ class Get extends AbstractRequestMethod implements InjectRouteInterface
|
||||
|
||||
|
||||
/**
|
||||
* @param ReflectionClass $class
|
||||
* @param string $class
|
||||
* @param string $method
|
||||
* @return void
|
||||
* @throws ReflectionException
|
||||
*/
|
||||
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, '/');
|
||||
|
||||
@@ -5,13 +5,11 @@ namespace Kiri\Router\Annotate;
|
||||
|
||||
use Kiri;
|
||||
use Kiri\Router\Constrict\RequestMethod;
|
||||
use Kiri\Router\Interface\InjectRouteInterface;
|
||||
use Kiri\Di\Interface\InjectMethodInterface;
|
||||
use Kiri\Router\Router;
|
||||
use ReflectionClass;
|
||||
use ReflectionException;
|
||||
|
||||
#[\Attribute(\Attribute::TARGET_METHOD | \Attribute::IS_REPEATABLE)]
|
||||
class Head extends AbstractRequestMethod implements InjectRouteInterface
|
||||
class Head extends AbstractRequestMethod implements InjectMethodInterface
|
||||
{
|
||||
|
||||
|
||||
@@ -25,14 +23,13 @@ class Head extends AbstractRequestMethod implements InjectRouteInterface
|
||||
|
||||
|
||||
/**
|
||||
* @param ReflectionClass $class
|
||||
* @param string $class
|
||||
* @param string $method
|
||||
* @return void
|
||||
* @throws ReflectionException
|
||||
*/
|
||||
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)) {
|
||||
|
||||
@@ -4,11 +4,10 @@ declare(strict_types=1);
|
||||
namespace Kiri\Router\Annotate;
|
||||
|
||||
|
||||
use Kiri\Router\Interface\InjectRouteInterface;
|
||||
use ReflectionClass;
|
||||
use Kiri\Di\Interface\InjectMethodInterface;
|
||||
|
||||
#[\Attribute(\Attribute::TARGET_METHOD)]
|
||||
class Interceptor implements InjectRouteInterface
|
||||
class Interceptor implements InjectMethodInterface
|
||||
{
|
||||
|
||||
public function __construct()
|
||||
@@ -17,11 +16,11 @@ class Interceptor implements InjectRouteInterface
|
||||
|
||||
|
||||
/**
|
||||
* @param ReflectionClass $class
|
||||
* @param string $class
|
||||
* @param string $method
|
||||
* @return void
|
||||
*/
|
||||
public function dispatch(ReflectionClass $class, string $method): void
|
||||
public function dispatch(string $class, string $method): void
|
||||
{
|
||||
// TODO: Implement dispatch() method.
|
||||
}
|
||||
|
||||
@@ -3,12 +3,11 @@ declare(strict_types=1);
|
||||
|
||||
namespace Kiri\Router\Annotate;
|
||||
|
||||
use Kiri\Di\Interface\InjectMethodInterface;
|
||||
use Kiri\Router\Base\Middleware as MiddlewareManager;
|
||||
use Kiri\Router\Interface\InjectRouteInterface;
|
||||
use ReflectionClass;
|
||||
|
||||
#[\Attribute(\Attribute::TARGET_METHOD | \Attribute::IS_REPEATABLE)]
|
||||
class Middleware implements InjectRouteInterface
|
||||
class Middleware implements InjectMethodInterface
|
||||
{
|
||||
|
||||
/**
|
||||
@@ -20,15 +19,15 @@ class Middleware implements InjectRouteInterface
|
||||
|
||||
|
||||
/**
|
||||
* @param ReflectionClass $class
|
||||
* @param string $class
|
||||
* @param string $method
|
||||
* @return void
|
||||
*/
|
||||
public function dispatch(ReflectionClass $class, string $method): void
|
||||
public function dispatch(string $class, string $method): void
|
||||
{
|
||||
$middlewareManager = \Kiri::getDi()->get(MiddlewareManager::class);
|
||||
|
||||
$middlewareManager->set($class->getName(), $method, $this->middleware);
|
||||
$middlewareManager->set($class, $method, $this->middleware);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -5,12 +5,11 @@ 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 Options extends AbstractRequestMethod implements InjectRouteInterface
|
||||
class Options extends AbstractRequestMethod implements InjectMethodInterface
|
||||
{
|
||||
|
||||
|
||||
@@ -29,9 +28,9 @@ class Options extends AbstractRequestMethod implements InjectRouteInterface
|
||||
* @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, '/');
|
||||
|
||||
@@ -5,13 +5,11 @@ namespace Kiri\Router\Annotate;
|
||||
|
||||
use Kiri;
|
||||
use Kiri\Router\Constrict\RequestMethod;
|
||||
use Kiri\Router\Interface\InjectRouteInterface;
|
||||
use Kiri\Router\Router;
|
||||
use ReflectionClass;
|
||||
use ReflectionException;
|
||||
use Kiri\Di\Interface\InjectMethodInterface;
|
||||
|
||||
#[\Attribute(\Attribute::TARGET_METHOD | \Attribute::IS_REPEATABLE)]
|
||||
class Post extends AbstractRequestMethod implements InjectRouteInterface
|
||||
class Post extends AbstractRequestMethod implements InjectMethodInterface
|
||||
{
|
||||
|
||||
|
||||
@@ -25,15 +23,14 @@ class Post extends AbstractRequestMethod implements InjectRouteInterface
|
||||
|
||||
|
||||
/**
|
||||
* @param ReflectionClass $class
|
||||
* @param string $class
|
||||
* @param string $method
|
||||
* @return void
|
||||
* @throws ReflectionException
|
||||
*/
|
||||
public function dispatch(ReflectionClass $class, string $method): void
|
||||
public function dispatch(string $class, string $method): void
|
||||
{
|
||||
// TODO: Implement dispatch() method.
|
||||
$controller = Kiri::getDi()->makeReflection($class);
|
||||
$controller = Kiri::getDi()->get($class);
|
||||
|
||||
$path = '/' . ltrim($this->path, '/');
|
||||
if (!empty($this->version)) {
|
||||
|
||||
@@ -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)) {
|
||||
|
||||
@@ -3,13 +3,11 @@
|
||||
namespace Kiri\Router\Annotate;
|
||||
|
||||
use Kiri\Router\Constrict\RequestMethod;
|
||||
use Kiri\Router\Interface\InjectRouteInterface;
|
||||
use Kiri\Router\Router;
|
||||
use ReflectionClass;
|
||||
use ReflectionException;
|
||||
use Kiri\Di\Interface\InjectMethodInterface;
|
||||
|
||||
#[\Attribute(\Attribute::TARGET_METHOD | \Attribute::IS_REPEATABLE)]
|
||||
class Route extends AbstractRequestMethod implements InjectRouteInterface
|
||||
class Route extends AbstractRequestMethod implements InjectMethodInterface
|
||||
{
|
||||
|
||||
|
||||
@@ -24,15 +22,13 @@ class Route extends AbstractRequestMethod implements InjectRouteInterface
|
||||
|
||||
|
||||
/**
|
||||
* @param ReflectionClass $class
|
||||
* @param string $class
|
||||
* @param string $method
|
||||
* @return void
|
||||
* @throws ReflectionException
|
||||
*/
|
||||
public function dispatch(ReflectionClass $class, string $method): void
|
||||
public function dispatch(string $class, string $method): void
|
||||
{
|
||||
$controller = \Kiri::getDi()->makeReflection($class);
|
||||
// TODO: Implement dispatch() method.
|
||||
$controller = \Kiri::getDi()->get($class);
|
||||
$path = '/' . ltrim($this->path, '/');
|
||||
if (!empty($this->version)) {
|
||||
$path = '/' . trim($this->version) . $path;
|
||||
|
||||
Reference in New Issue
Block a user