for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
declare(strict_types=1);
/*
* This file is part of the Thunder micro CLI framework.
* (c) Jérémy Marodon <[email protected]>
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace RxThunder\Core\Router;
use RxThunder\Core\Model\DataModel;
class Router
{
protected RouteCollection $collection;
protected Matcher $matcher;
public function __construct()
$this->collection = new RouteCollection();
$this->matcher = new Matcher($this->collection);
}
public function match(DataModel $data_model): Route
return $this->matcher->match($data_model->getType());
public function addRoute(Route $route): self
$this->collection->add($route);
return $this;