diff options
Diffstat (limited to 'src/Router.php')
| -rw-r--r-- | src/Router.php | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/src/Router.php b/src/Router.php index ddd3220..87f7931 100644 --- a/src/Router.php +++ b/src/Router.php @@ -7,8 +7,6 @@ namespace Lightscale\Router; use Lightscale\Router\Contracts\Strategy; use Lightscale\Router\Enums\HttpMethod; use Lightscale\Router\Enums\PathSegmentType; -use Lightscale\Router\Exceptions\NotFoundException; -use Lightscale\Router\Exceptions\UnknownMethodException; use Psr\Http\Message\RequestInterface; use Psr\Http\Message\ResponseInterface; @@ -20,7 +18,7 @@ class Router public function __construct() { $this->root = new PathSegment(type: PathSegmentType::Root); - $this->strategy = new BasicStrategy; + $this->strategy = new BasicStrategy(); } public function getStrategy(): Strategy @@ -80,7 +78,7 @@ class Router $method = $request->getMethod(); $method = HttpMethod::tryFrom(strtolower($method)); - if ($method === null) { + if (null === $method) { return $this->strategy->notFound($request); } @@ -104,7 +102,7 @@ class Router $pathSplit = $this->splitPath($path); $seg = $this->root(); - while(($v = array_shift($pathSplit)) !== null) { + while (($v = array_shift($pathSplit)) !== null) { $seg = $seg->child($v); } |
