Files
kiri-core/http-helper/Route/HandlerProviders.php
T
2021-08-30 17:34:57 +08:00

40 lines
589 B
PHP

<?php
namespace Http\Route;
use Kiri\Abstracts\BaseObject;
/**
*
*/
class HandlerProviders extends BaseObject
{
private static array $handlers = [];
/**
* @param $path
* @param $method
* @return mixed
*/
public static function get($path, $method): mixed
{
return static::$handlers[$method][$path] ?? null;
}
/**
* @param $method
* @param $path
* @param $handler
* @param $_injectParameters
*/
public static function add($method, $path, $handler, $_injectParameters)
{
static::$handlers[$method][$path] = [$handler, $_injectParameters];
}
}