Skip to content

Commit

Permalink
Merge pull request #286 from alexander-schranz/enhancement/php-84-dep…
Browse files Browse the repository at this point in the history
…recations

Fix PHP 8.4 deprecations nullable objects
  • Loading branch information
dbu authored Dec 2, 2024
2 parents 3a3c645 + 000586d commit 8385485
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 4 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/test-application.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ jobs:
- php-version: "8.2"
- php-version: "8.3"
symfony-version: "7"
- php-version: "8.4"
symfony-version: "7"

steps:
- name: "Checkout project"
Expand Down
4 changes: 2 additions & 2 deletions src/ChainRouter.php
Original file line number Diff line number Diff line change
Expand Up @@ -247,8 +247,8 @@ private function rebuildRequest(string $pathinfo): Request

private function getErrorMessage(
string $name,
RouterInterface|UrlGeneratorInterface|RequestMatcherInterface $router = null,
array $parameters = null
RouterInterface|UrlGeneratorInterface|RequestMatcherInterface|null $router = null,
?array $parameters = null
): string {
if ($router instanceof VersatileGeneratorInterface) {
// the $parameters are not forced to be array, but versatile generator does typehint it
Expand Down
2 changes: 1 addition & 1 deletion src/Event/RouterMatchEvent.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ final class RouterMatchEvent extends Event
{
private ?Request $request;

public function __construct(Request $request = null)
public function __construct(?Request $request = null)
{
$this->request = $request;
}
Expand Down
2 changes: 1 addition & 1 deletion src/ProviderBasedGenerator.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ class ProviderBasedGenerator extends UrlGenerator implements VersatileGeneratorI
{
protected RouteProviderInterface $provider;

public function __construct(RouteProviderInterface $provider, LoggerInterface $logger = null)
public function __construct(RouteProviderInterface $provider, ?LoggerInterface $logger = null)
{
$this->provider = $provider;
$this->logger = $logger ?: new NullLogger();
Expand Down

0 comments on commit 8385485

Please sign in to comment.