8000 feat: using coalescing operator in file function · symfony/symfony@3de59c9 · GitHub
[go: up one dir, main page]

Skip to content

Commit 3de59c9

Browse files
BASAKSemihnicolas-grekas
authored andcommitted
feat: using coalescing operator in file function
1 parent 116784b commit 3de59c9

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/Symfony/Bundle/FrameworkBundle/Controller/AbstractController.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,7 @@ protected function json(mixed $data, int $status = 200, array $headers = [], arr
166166
protected function file(\SplFileInfo|string $file, string $fileName = null, string $disposition = ResponseHeaderBag::DISPOSITION_ATTACHMENT): BinaryFileResponse
167167
{
168168
$response = new BinaryFileResponse($file);
169-
$response->setContentDisposition($disposition, null === $fileName ? $response->getFile()->getFilename() : $fileName);
169+
$response->setContentDisposition($disposition, $fileName ?? $response->getFile()->getFilename());
170170

171171
return $response;
172172
}

0 commit comments

Comments
 (0)
0