Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
## [3.0.0] - TBD

Upgrade guide: https://github.com/softberg/quantum-php-docs/blob/master/v3.0/upgrade-guide.md

### Changed
- **BREAKING:** Refactored app bootstrapping and DI ownership model (#373):
- Introduced `AppContext` as the central execution state holder (mode, baseDir, DiContainer, Environment, Config, Request, Response, Routes)
Expand Down Expand Up @@ -53,7 +55,6 @@
- Routing is executed once per request; matched route is stored on the `Request`
- Global route helper functions (`current_*`, `route_*`) now rely on `MatchedRoute` instead of legacy static route state
- Middleware ordering is strictly prepend-based (later middleware wraps earlier)
- Nested route groups are no longer supported
- Route name uniqueness is now enforced at build time

- **BREAKING:** Controller resolution behavior changed:
Expand Down
7 changes: 4 additions & 3 deletions src/App/Adapters/WebAppAdapter.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@

use Quantum\Middleware\Exceptions\MiddlewareException;
use Quantum\Loader\Exceptions\LoaderException;
use Quantum\Module\Exceptions\ModuleException;
use Quantum\Config\Exceptions\ConfigException;
use Quantum\App\Stages\SetupErrorHandlerStage;
use Quantum\Router\Exceptions\RouteException;
Expand All @@ -39,6 +38,8 @@
use Quantum\App\Enums\ExitCode;
use Quantum\App\BootPipeline;
use Quantum\App\AppContext;
use Quantum\Http\Response;
use Quantum\Http\Request;
use ReflectionException;

/**
Expand Down Expand Up @@ -68,7 +69,7 @@ public function __construct(AppContext $context)

/**
* Starts the web app
* @throws ModuleException|MiddlewareException|LangException|RouteException|CsrfException|ConfigException|DiException|BaseException|LoaderException|ReflectionException
* @throws MiddlewareException|LangException|RouteException|CsrfException|ConfigException|DiException|BaseException|LoaderException|ReflectionException
*/
public function start(): ?int
{
Expand All @@ -91,7 +92,7 @@ public function start(): ?int

$viewCache = $this->setupViewCache();

$terminal = fn ($request) => $viewCache->getCachedResponse($request->getUri() ?? '')
$terminal = fn (Request $request): Response => $viewCache->getCachedResponse($request->getUri() ?? '')
?? (new RouteDispatcher())->dispatch($matchedRoute, $request);

$response = (new MiddlewareManager($matchedRoute))->applyMiddlewares(request(), $terminal);
Expand Down
Loading