Skip to content

Commit 8385485

Browse files
authored
Merge pull request #286 from alexander-schranz/enhancement/php-84-deprecations
Fix PHP 8.4 deprecations nullable objects
2 parents 3a3c645 + 000586d commit 8385485

File tree

4 files changed

+6
-4
lines changed

4 files changed

+6
-4
lines changed

.github/workflows/test-application.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,8 @@ jobs:
3030
- php-version: "8.2"
3131
- php-version: "8.3"
3232
symfony-version: "7"
33+
- php-version: "8.4"
34+
symfony-version: "7"
3335

3436
steps:
3537
- name: "Checkout project"

src/ChainRouter.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -247,8 +247,8 @@ private function rebuildRequest(string $pathinfo): Request
247247

248248
private function getErrorMessage(
249249
string $name,
250-
RouterInterface|UrlGeneratorInterface|RequestMatcherInterface $router = null,
251-
array $parameters = null
250+
RouterInterface|UrlGeneratorInterface|RequestMatcherInterface|null $router = null,
251+
?array $parameters = null
252252
): string {
253253
if ($router instanceof VersatileGeneratorInterface) {
254254
// the $parameters are not forced to be array, but versatile generator does typehint it

src/Event/RouterMatchEvent.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ final class RouterMatchEvent extends Event
1818
{
1919
private ?Request $request;
2020

21-
public function __construct(Request $request = null)
21+
public function __construct(?Request $request = null)
2222
{
2323
$this->request = $request;
2424
}

src/ProviderBasedGenerator.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ class ProviderBasedGenerator extends UrlGenerator implements VersatileGeneratorI
2626
{
2727
protected RouteProviderInterface $provider;
2828

29-
public function __construct(RouteProviderInterface $provider, LoggerInterface $logger = null)
29+
public function __construct(RouteProviderInterface $provider, ?LoggerInterface $logger = null)
3030
{
3131
$this->provider = $provider;
3232
$this->logger = $logger ?: new NullLogger();

0 commit comments

Comments
 (0)