summaryrefslogtreecommitdiff
path: root/src/Router.php
diff options
context:
space:
mode:
authorSam Light <sam@lightscale.co.uk>2026-06-10 19:00:32 +0100
committerSam Light <sam@lightscale.co.uk>2026-06-10 19:00:32 +0100
commit7a19b83bf7d7d8a2650356168cdb296b6f82807f (patch)
tree81891e5791d18daa8ec34497131fb65615039858 /src/Router.php
parent8c0efd0d9317ad92bd55cd6afcd41bdbab827bf8 (diff)
code formatting
Diffstat (limited to 'src/Router.php')
-rw-r--r--src/Router.php8
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);
}