diff --git a/src/Tempest/Router/src/Exceptions/ControllerActionHasNoReturn.php b/src/Tempest/Router/src/Exceptions/ControllerActionHasNoReturn.php index ba8435ceb..247eb3873 100644 --- a/src/Tempest/Router/src/Exceptions/ControllerActionHasNoReturn.php +++ b/src/Tempest/Router/src/Exceptions/ControllerActionHasNoReturn.php @@ -5,7 +5,7 @@ namespace Tempest\Router\Exceptions; use Exception; -use Tempest\Router\Construction\DiscoveredRoute; +use Tempest\Router\Routing\Construction\DiscoveredRoute; final class ControllerActionHasNoReturn extends Exception { diff --git a/src/Tempest/Router/src/GenericRouter.php b/src/Tempest/Router/src/GenericRouter.php index 057234c6d..ffb9fa2d3 100644 --- a/src/Tempest/Router/src/GenericRouter.php +++ b/src/Tempest/Router/src/GenericRouter.php @@ -144,7 +144,7 @@ public function toUri(array|string $action, ...$params): string $uri = $uri->replaceRegex( '#\{' . $key . DiscoveredRoute::ROUTE_PARAM_CUSTOM_REGEX . '\}#', - (string)$value + (string) $value, ); } diff --git a/src/Tempest/Router/src/RouteConfig.php b/src/Tempest/Router/src/RouteConfig.php index c1b8e1ea5..13ebe415c 100644 --- a/src/Tempest/Router/src/RouteConfig.php +++ b/src/Tempest/Router/src/RouteConfig.php @@ -4,8 +4,8 @@ namespace Tempest\Router; -use Tempest\Router\Routing\Matching\MatchingRegex; use Tempest\Router\Routing\Construction\DiscoveredRoute; +use Tempest\Router\Routing\Matching\MatchingRegex; final class RouteConfig { diff --git a/src/Tempest/Router/src/RouteDiscovery.php b/src/Tempest/Router/src/RouteDiscovery.php index 323c334b5..a832fa018 100644 --- a/src/Tempest/Router/src/RouteDiscovery.php +++ b/src/Tempest/Router/src/RouteDiscovery.php @@ -7,9 +7,9 @@ use Tempest\Core\Discovery; use Tempest\Core\DiscoveryLocation; use Tempest\Core\IsDiscovery; +use Tempest\Reflection\ClassReflector; use Tempest\Router\Routing\Construction\DiscoveredRoute; use Tempest\Router\Routing\Construction\RouteConfigurator; -use Tempest\Reflection\ClassReflector; final class RouteDiscovery implements Discovery { diff --git a/src/Tempest/Router/src/Routing/Construction/DiscoveredRoute.php b/src/Tempest/Router/src/Routing/Construction/DiscoveredRoute.php index 8b5aadf74..0f5105a1e 100644 --- a/src/Tempest/Router/src/Routing/Construction/DiscoveredRoute.php +++ b/src/Tempest/Router/src/Routing/Construction/DiscoveredRoute.php @@ -60,7 +60,7 @@ public function split(): array $parts = explode('/', $this->uri); return array_values( - array_filter($parts, static fn (string $part) => $part !== '') + array_filter($parts, static fn (string $part) => $part !== ''), ); } diff --git a/src/Tempest/Router/src/Routing/Construction/RouteTreeNode.php b/src/Tempest/Router/src/Routing/Construction/RouteTreeNode.php index e8313de45..3ef3ccbd4 100644 --- a/src/Tempest/Router/src/Routing/Construction/RouteTreeNode.php +++ b/src/Tempest/Router/src/Routing/Construction/RouteTreeNode.php @@ -4,7 +4,6 @@ namespace Tempest\Router\Routing\Construction; - /** * @internal */ diff --git a/src/Tempest/Router/tests/FakeRouteBuilder.php b/src/Tempest/Router/tests/FakeRouteBuilder.php index 41870e5d4..1eecf96d5 100644 --- a/src/Tempest/Router/tests/FakeRouteBuilder.php +++ b/src/Tempest/Router/tests/FakeRouteBuilder.php @@ -6,10 +6,10 @@ use ReflectionMethod; use Tempest\Http\Method; -use Tempest\Router\Routing\Construction\DiscoveredRoute; -use Tempest\Router\Routing\Construction\MarkedRoute; use Tempest\Reflection\MethodReflector; use Tempest\Router\Route; +use Tempest\Router\Routing\Construction\DiscoveredRoute; +use Tempest\Router\Routing\Construction\MarkedRoute; final readonly class FakeRouteBuilder implements Route { diff --git a/src/Tempest/Router/tests/Routing/Construction/RouteConfiguratorTest.php b/src/Tempest/Router/tests/Routing/Construction/RouteConfiguratorTest.php index d687fd445..59ba92dd9 100644 --- a/src/Tempest/Router/tests/Routing/Construction/RouteConfiguratorTest.php +++ b/src/Tempest/Router/tests/Routing/Construction/RouteConfiguratorTest.php @@ -6,10 +6,6 @@ use PHPUnit\Framework\TestCase; use Tempest\Http\Method; -use Tempest\Router\Delete; -use Tempest\Router\Patch; -use Tempest\Router\Put; -use Tempest\Router\Route; use Tempest\Router\RouteConfig; use Tempest\Router\Routing\Construction\RouteConfigurator; use Tempest\Router\Routing\Matching\MatchingRegex; diff --git a/src/Tempest/Router/tests/Routing/Construction/RoutingTreeTest.php b/src/Tempest/Router/tests/Routing/Construction/RoutingTreeTest.php index 3679bdf17..e80a0cbad 100644 --- a/src/Tempest/Router/tests/Routing/Construction/RoutingTreeTest.php +++ b/src/Tempest/Router/tests/Routing/Construction/RoutingTreeTest.php @@ -62,7 +62,7 @@ public function test_chunked_routes(): void for ($i = 0; $i <= 1000; $i++) { $mark = str_increment($mark); $subject->add( - $routeBuilder->withUri("/test/{$i}/route_{$i}")->asMarkedRoute($mark) + $routeBuilder->withUri("/test/{$i}/route_{$i}")->asMarkedRoute($mark), ); } diff --git a/src/Tempest/Router/tests/Routing/Matching/GenericRouteMatcherTest.php b/src/Tempest/Router/tests/Routing/Matching/GenericRouteMatcherTest.php index 1ec2d5fdd..d8e5f5fd6 100644 --- a/src/Tempest/Router/tests/Routing/Matching/GenericRouteMatcherTest.php +++ b/src/Tempest/Router/tests/Routing/Matching/GenericRouteMatcherTest.php @@ -7,10 +7,10 @@ use Laminas\Diactoros\ServerRequest; use PHPUnit\Framework\TestCase; use Tempest\Http\Method; -use Tempest\Router\Tests\FakeRouteBuilder; use Tempest\Router\RouteConfig; use Tempest\Router\Routing\Matching\GenericRouteMatcher; use Tempest\Router\Routing\Matching\MatchingRegex; +use Tempest\Router\Tests\FakeRouteBuilder; /** * @internal diff --git a/tests/Architecture/ArchitectureTestCase.php b/tests/Architecture/ArchitectureTestCase.php index 24e2ab08a..e2635472c 100644 --- a/tests/Architecture/ArchitectureTestCase.php +++ b/tests/Architecture/ArchitectureTestCase.php @@ -9,7 +9,6 @@ use PHPat\Test\Builder\Rule; use PHPat\Test\PHPat; use Tempest\Framework\Testing\IntegrationTest; -use Tempest\Router\Route; final class ArchitectureTestCase { diff --git a/tests/Benchmark/Http/Routing/Construction/RouteConfiguratorBench.php b/tests/Benchmark/Http/Routing/Construction/RouteConfiguratorBench.php index e1a6b54b5..a1e8d3f4f 100644 --- a/tests/Benchmark/Http/Routing/Construction/RouteConfiguratorBench.php +++ b/tests/Benchmark/Http/Routing/Construction/RouteConfiguratorBench.php @@ -7,8 +7,6 @@ use PhpBench\Attributes\BeforeMethods; use PhpBench\Attributes\Revs; use PhpBench\Attributes\Warmup; -use Tempest\Http\Method; -use Tempest\Router\Route; use Tempest\Router\Routing\Construction\RouteConfigurator; use Tempest\Router\Tests\FakeRouteBuilder;