-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[HttpFoundation] Make ResponseHeaderBag::makeDisposition static #28807
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
Conversation
fabpot
commented
Oct 10, 2018
Q | A |
---|---|
Branch? | master |
Bug fix? | no |
New feature? | yes-ish |
BC breaks? | no |
Deprecations? | no |
Tests pass? | yes |
Fixed tickets | #27851 |
License | MIT |
Doc PR | n/a |
0dbb78a
to
4c4ad02
Compare
* @throws \InvalidArgumentException | ||
* | ||
* @see RFC 6266 | ||
* @see HeaderUtils::makeDisposition() | ||
*/ | ||
public function makeDisposition($disposition, $filename, $filenameFallback = '') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
shall we deprecate then?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not sure it's worth it.
* | ||
* @see RFC 6266 | ||
*/ | ||
public static function makeDisposition($disposition, $filename, $filenameFallback = '') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why not using null
as default here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've just moved the code and don't want to make other changes.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Makes sense 👍
Thank you!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
IMO new code should have type declarations.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
* | ||
* @param string $disposition One of "inline" or "attachment" | ||
* @param string $filename A unicode string | ||
* @param string $filenameFallback A string containing only ASCII characters that |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
IMO $fallback
would be enough in this context
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Totally unrelated to this PR, but I always find hard to understand what does "disposition attachment" and "disposition inline" mean. Normal people call this "download file" and "display file". Maybe we should add some helpers somewhere?
4c4ad02
to
03471a3
Compare
03471a3
to
d29b410
Compare
…on static (fabpot) This PR was merged into the 4.2-dev branch. Discussion ---------- [HttpFoundation] Make ResponseHeaderBag::makeDisposition static | Q | A | ------------- | --- | Branch? | master | Bug fix? | no | New feature? | yes-ish | BC breaks? | no | Deprecations? | no <!-- don't forget to update UPGRADE-*.md and src/**/CHANGELOG.md files --> | Tests pass? | yes | Fixed tickets | #27851 | License | MIT | Doc PR | n/a <!-- Write a short README entry for your feature/bugfix here (replace this comment block.) This will help people understand your PR and can be used as a start of the Doc PR. Additionally: - Bug fixes must be submitted against the lowest branch where they apply (lowest branches are regularly merged to upper ones so they get the fixes too). - Features and deprecations must be submitted against the master branch. --> Commits ------- d29b410 [HttpFoundation] made ResponseHeaderBag::makeDisposition static
This PR was merged into the 4.2-dev branch. Discussion ---------- [HttpFoundation] Publicify new consts | Q | A | ------------- | --- | Branch? | master | Bug fix? | no | New feature? | yes | BC breaks? | no <!-- see https://symfony.com/bc --> | Deprecations? | no | Tests pass? | yes <!-- please add some, will be required by reviewers --> | Fixed tickets | #... <!-- #-prefixed issue number(s), if any --> | License | MIT | Doc PR | symfony/symfony-docs#... <!-- required for new features --> Continuation of #28807 I think it's reasonable to enforce visibility for new consts, ideally solved by PHP-CS-Fixer. This makes it explicit for the consts to be consumed as part of public API. Commits ------- ce95d0d [HttpFoundation] Publicify new consts