Files
kiri-router/src/DataGrip.php
T

30 lines
431 B
PHP
Raw Normal View History

2023-04-15 23:29:27 +08:00
<?php
2023-04-16 01:24:30 +08:00
declare(strict_types=1);
2023-04-15 23:29:27 +08:00
2023-04-15 23:31:16 +08:00
namespace Kiri\Router;
2023-04-15 23:29:27 +08:00
use Kiri;
2023-04-15 23:31:16 +08:00
use ReflectionException;
2023-04-15 23:29:27 +08:00
class DataGrip
{
private array $servers = [];
/**
* @param $type
* @return RouterCollector
2023-04-15 23:31:16 +08:00
* @throws ReflectionException
2023-04-15 23:29:27 +08:00
*/
public function get($type): RouterCollector
{
if (!isset($this->servers[$type])) {
2023-04-15 23:31:16 +08:00
$this->servers[$type] = Kiri::getDi()->make(RouterCollector::class);
2023-04-15 23:29:27 +08:00
}
return $this->servers[$type];
}
}