Files
kiri-core/http-helper/Route/HandlerProviders.php
T
as2252258@163.com 5e1a3f7148 111
2021-08-28 02:08:20 +08:00

39 lines
517 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
*/
public static function add($method, $path, $handler)
{
static::$handlers[$method][$path] = $handler;
}
}