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\Router\Exception\RouteNotFoundException;
class Matcher
{
protected RouteCollection $routes;
public function __construct(RouteCollection $routes)
$this->routes = $routes;
}
public function match(string $type): Route
if ($route = $this->routes->get($type)) {
return $route;
throw new RouteNotFoundException($type);
RxThunder\Core\Router\Ex...\RouteNotFoundException
If this is a false-positive, you can also ignore this issue in your code via the ignore-deprecated annotation
ignore-deprecated
throw /** @scrutinizer ignore-deprecated */ new RouteNotFoundException($type);