Skip to content

Commit

Permalink
Merge pull request #21 from markstory/45-fixes
Browse files Browse the repository at this point in the history
Improve compatibility with CakePHP 4.5 and PHP 8.2
  • Loading branch information
ishanvyas22 authored Jul 26, 2023
2 parents 647fb84 + 741e36a commit ca58a35
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/Middleware/InertiaMiddleware.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,12 @@ class InertiaMiddleware implements MiddlewareInterface
*/
public function process(ServerRequestInterface $request, RequestHandlerInterface $handler): ResponseInterface
{
if (!$request->hasHeader('X-Inertia')) {
return $handler->handle($request);
}
if ($request instanceof ServerRequest) {
$this->setupDetectors($request);
}
if (!$request->hasHeader('X-Inertia')) {
return $handler->handle($request);
}

$response = $handler->handle($request);
if (
Expand Down
2 changes: 2 additions & 0 deletions tests/TestCase/View/InertiaJsonViewTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@

class InertiaJsonViewTest extends TestCase
{
public $View;

public function setUp(): void
{
parent::setUp();
Expand Down

0 comments on commit ca58a35

Please sign in to comment.