8000 [AbstractController] Using coalescing operator by BASAKSemih · Pull Request #48453 · symfony/symfony · GitHub
[go: up one dir, main page]

Skip to content

[AbstractController] Using coalescing operator #48453

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
feat: using coalescing operator in file function
  • Loading branch information
BASAKSemih authored and nicolas-grekas committed Dec 4, 2022
commit 3de59c9b8009116d7300e7de2274a014427c971e
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ protected function json(mixed $data, int $status = 200, array $headers = [], arr
protected function file(\SplFileInfo|string $file, string $fileName = null, string $disposition = ResponseHeaderBag::DISPOSITION_ATTACHMENT): BinaryFileResponse
{
$response = new BinaryFileResponse($file);
$response->setContentDisposition($disposition, null === $fileName ? $response->getFile()->getFilename() : $fileName);
$response->setContentDisposition($disposition, $fileName ?? $response->getFile()->getFilename());

return $response;
}
Expand Down
0