Files
kiri-core/http-helper/Route/HandlerProviders.php
T
2021-08-17 16:43:50 +08:00

39 lines
486 B
PHP

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