This commit is contained in:
2021-08-17 16:43:50 +08:00
parent 539ba488e9
commit 5b1e28c323
80 changed files with 232 additions and 396 deletions
+38
View File
@@ -0,0 +1,38 @@
<?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;
}
}