Skip to content

Commit d64037c

Browse files
tobias-93bobvandevijver
authored andcommitted
Fix nullable typing causing a deprecation in PHP 8.4
1 parent e87d35b commit d64037c

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

Form/EventListener/SingleUploadSubscriber.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ public function postSubmit(FormEvent $event): void
149149
}
150150
}
151151

152-
private function isFieldSingleUpload(ResolvedFormTypeInterface $formTypeInterface = null): bool
152+
private function isFieldSingleUpload(?ResolvedFormTypeInterface $formTypeInterface = null): bool
153153
{
154154
if ($formTypeInterface == null) {
155155
return false;

Storage/FileStorageInterface.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,5 @@ interface FileStorageInterface
77
{
88
public function storeFiles(array $files): array;
99

10-
public function getFile(string $fileId = null): ?UploadedFile;
10+
public function getFile(?string $fileId = null): ?UploadedFile;
1111
}

Storage/LocalFileStorage.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ class LocalFileStorage implements FileStorageInterface
1818

1919
private SessionInterface $session;
2020

21-
public function __construct(private readonly RequestStack $requestStack, string $tempDir = null)
21+
public function __construct(private readonly RequestStack $requestStack, ?string $tempDir = null)
2222
{
2323
$this->temporaryDirectory = $tempDir ?: sys_get_temp_dir() . DIRECTORY_SEPARATOR . 's2a' . DIRECTORY_SEPARATOR . 'collectionupload';
2424
}
@@ -52,7 +52,7 @@ public function storeFiles(array $files): array
5252
return $handledFiles;
5353
}
5454

55-
public function getFile(string $fileId = null): ?UploadedFile
55+
public function getFile(?string $fileId = null): ?UploadedFile
5656
{
5757
if (is_null($fileId)) {
5858
return null;

0 commit comments

Comments
 (0)