Skip to content

Commit b7f99a8

Browse files
authored
refactor: move http router to separate package
1 parent b2ac131 commit b7f99a8

File tree

193 files changed

+543
-469
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

193 files changed

+543
-469
lines changed

composer.json

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,7 @@
7171
"tempest/log": "self.version",
7272
"tempest/mapper": "self.version",
7373
"tempest/reflection": "self.version",
74+
"tempest/router": "self.version",
7475
"tempest/support": "self.version",
7576
"tempest/validation": "self.version",
7677
"tempest/view": "self.version"
@@ -97,6 +98,7 @@
9798
"Tempest\\Log\\": "src/Tempest/Log/src",
9899
"Tempest\\Mapper\\": "src/Tempest/Mapper/src",
99100
"Tempest\\Reflection\\": "src/Tempest/Reflection/src",
101+
"Tempest\\Router\\": "src/Tempest/Router/src",
100102
"Tempest\\Support\\": "src/Tempest/Support/src",
101103
"Tempest\\Validation\\": "src/Tempest/Validation/src",
102104
"Tempest\\View\\": "src/Tempest/View/src"
@@ -107,9 +109,9 @@
107109
"src/Tempest/Core/src/functions.php",
108110
"src/Tempest/Debug/src/functions.php",
109111
"src/Tempest/EventBus/src/functions.php",
110-
"src/Tempest/Http/src/functions.php",
111112
"src/Tempest/Mapper/src/functions.php",
112113
"src/Tempest/Reflection/src/functions.php",
114+
"src/Tempest/Router/src/functions.php",
113115
"src/Tempest/Support/src/functions.php",
114116
"src/Tempest/View/src/functions.php"
115117
]
@@ -128,10 +130,14 @@
128130
"Tempest\\Filesystem\\Tests\\": "src/Tempest/Filesystem/tests",
129131
"Tempest\\Generation\\Tests\\": "src/Tempest/Generation/tests",
130132
"Tempest\\HttpClient\\Tests\\": "src/Tempest/HttpClient/tests",
131-
"Tempest\\Http\\Tests\\": "src/Tempest/Http/tests",
133+
"Tempest\\Http\\Tests\\": [
134+
"src/Tempest/Http/tests",
135+
"src/Tempest/Router/tests"
136+
],
132137
"Tempest\\Log\\Tests\\": "src/Tempest/Log/tests",
133138
"Tempest\\Mapper\\Tests\\": "src/Tempest/Mapper/tests",
134139
"Tempest\\Reflection\\Tests\\": "src/Tempest/Reflection/tests",
140+
"Tempest\\Router\\Tests\\": "src/Tempest/Router/tests",
135141
"Tempest\\Support\\Tests\\": "src/Tempest/Support/tests",
136142
"Tempest\\Validation\\Tests\\": "src/Tempest/Validation/tests",
137143
"Tests\\Tempest\\": "tests/"

phpstan.neon.dist

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ parameters:
1919

2020
-
2121
message: '#.*#'
22-
path: src/Tempest/Http/src/Exceptions/exception.php
22+
path: src/Tempest/Router/src/Exceptions/exception.php
2323
-
2424
message: '#.*exec*#'
2525
path: src/Tempest/Console/src/Terminal/Terminal.php

public/index.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
declare(strict_types=1);
44

55
use Tempest\Core\DiscoveryLocation;
6-
use Tempest\Http\HttpApplication;
6+
use Tempest\Router\HttpApplication;
77

88
require_once __DIR__ . '/../vendor/autoload.php';
99

rector.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,8 +59,8 @@
5959
EncapsedStringsToSprintfRector::class,
6060
AddArrowFunctionReturnTypeRector::class,
6161
])
62-
->withSkipPath(__DIR__ .'/src/Tempest/Http/src/Exceptions/HttpProductionErrorHandler.php')
63-
->withSkipPath(__DIR__ .'/src/Tempest/Http/src/Exceptions/exception.php')
62+
->withSkipPath(__DIR__ .'/src/Tempest/Router/src/Exceptions/HttpProductionErrorHandler.php')
63+
->withSkipPath(__DIR__ . '/src/Tempest/Router/src/Exceptions/exception.php')
6464
->withParallel(300, 10, 10)
6565
->withPreparedSets(
6666
codeQuality: false,

src/Tempest/Auth/composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"require": {
55
"php": "^8.4",
66
"tempest/core": "dev-main",
7-
"tempest/http": "dev-main",
7+
"tempest/router": "dev-main",
88
"tempest/database": "dev-main"
99
},
1010
"autoload": {

src/Tempest/Auth/src/AuthBootstrap.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
use Tempest\Core\KernelEvent;
88
use Tempest\EventBus\EventHandler;
9-
use Tempest\Http\Router;
9+
use Tempest\Router\Router;
1010

1111
final readonly class AuthBootstrap
1212
{

src/Tempest/Auth/src/AuthorizerMiddleware.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,12 @@
55
namespace Tempest\Auth;
66

77
use Tempest\Container\Container;
8-
use Tempest\Http\HttpMiddleware;
9-
use Tempest\Http\HttpMiddlewareCallable;
10-
use Tempest\Http\MatchedRoute;
11-
use Tempest\Http\Request;
12-
use Tempest\Http\Response;
13-
use Tempest\Http\Responses\Forbidden;
8+
use Tempest\Router\HttpMiddleware;
9+
use Tempest\Router\HttpMiddlewareCallable;
10+
use Tempest\Router\MatchedRoute;
11+
use Tempest\Router\Request;
12+
use Tempest\Router\Response;
13+
use Tempest\Router\Responses\Forbidden;
1414

1515
final readonly class AuthorizerMiddleware implements HttpMiddleware
1616
{

src/Tempest/Auth/src/SessionAuthenticator.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44

55
namespace Tempest\Auth;
66

7-
use Tempest\Http\Session\Session;
87
use Tempest\Reflection\ClassReflector;
8+
use Tempest\Router\Session\Session;
99

1010
final readonly class SessionAuthenticator implements Authenticator
1111
{

src/Tempest/Core/src/Kernel.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
use Tempest\Core\Kernel\LoadDiscoveryClasses;
1414
use Tempest\Core\Kernel\LoadDiscoveryLocations;
1515
use Tempest\EventBus\EventBus;
16-
use Tempest\Http\Exceptions\HttpProductionErrorHandler;
16+
use Tempest\Router\Exceptions\HttpProductionErrorHandler;
1717
use Whoops\Handler\PrettyPageHandler;
1818
use Whoops\Run;
1919

src/Tempest/Framework/Application/ApplicationInitializer.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
use Tempest\Container\Singleton;
1212
use Tempest\Core\AppConfig;
1313
use Tempest\Core\Application;
14-
use Tempest\Http\HttpApplication;
14+
use Tempest\Router\HttpApplication;
1515

1616
final readonly class ApplicationInitializer implements Initializer
1717
{

0 commit comments

Comments
 (0)