Skip to content

Commit

Permalink
fix: try fix php test error for php 8
Browse files Browse the repository at this point in the history
  • Loading branch information
ga-devfront committed Oct 22, 2024
1 parent 5e7a721 commit 99f0d10
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion classes/AjaxResponseBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,6 @@ public static function errorResponse(string $error, ?int $errorNumber): JsonResp
{
return new JsonResponse([
'error' => $error,
], $errorNumber ?? 400);
], $errorNumber ? $errorNumber : 400);
}
}
2 changes: 1 addition & 1 deletion classes/Router/Router.php
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ public function __construct(UpgradeContainer $upgradeContainer)
*/
public function handle(Request $request)
{
$route = self::ROUTES[$request->query->get('route')] ?? self::ROUTES[Routes::HOME_PAGE];
$route = self::ROUTES[$request->query->get('route')] ? self::ROUTES[$request->query->get('route')] : self::ROUTES[Routes::HOME_PAGE];

Check failure on line 122 in classes/Router/Router.php

View workflow job for this annotation

GitHub Actions / PHPStan (1.7.2.5)

Ternary operator condition is always true.

Check failure on line 122 in classes/Router/Router.php

View workflow job for this annotation

GitHub Actions / PHPStan (1.7.3.4)

Ternary operator condition is always true.

Check failure on line 122 in classes/Router/Router.php

View workflow job for this annotation

GitHub Actions / PHPStan (1.7.4.4)

Ternary operator condition is always true.

Check failure on line 122 in classes/Router/Router.php

View workflow job for this annotation

GitHub Actions / PHPStan (1.7.5.1)

Ternary operator condition is always true.

Check failure on line 122 in classes/Router/Router.php

View workflow job for this annotation

GitHub Actions / PHPStan (1.7.6)

Ternary operator condition is always true.

Check failure on line 122 in classes/Router/Router.php

View workflow job for this annotation

GitHub Actions / PHPStan (1.7.7)

Ternary operator condition is always true.

$method = $route['method'];

Expand Down

0 comments on commit 99f0d10

Please sign in to comment.