-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[RFC] Rename some HeaderUtils methods #27026
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
Comments
|
I'm personally not a fan of the name |
|
It's been a while since I wrote the patch, so I no longer remember exactly what went through my head back then :-) I did give it some consideration, but I wasn't too happy with the result. The thing is that the functions are not inverse, like PHP's
If, and only if, there are at least two separator characters and the last is It seems that I'm not so fond of the name An alternative name for Anyway, I'll be happy to add whatever decision we come up with to #27019 (or a separate PR). |
This needs to be taken care of asap, before 4.1 is tagged. Any decision? |
@nicolas-grekas do you have some ideas for this possible renaming? After reading @c960657's comment it looks like |
I have created PR #27087 that changes the names to I do not mean to shortcut the discussion. I have just prepared the PR to speed up things, if there is consensus about the suggested renaming. |
This PR was merged into the 4.1-dev branch. Discussion ---------- [HttpFoundation] Rename HeaderUtils methods | Q | A | ------------- | --- | Branch? | master | Bug fix? | no | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | #27026 | License | MIT | Doc PR | Rename new HeaderUtils methods as discussed in #27026. Commits ------- 484d1fb [HttpFoundation] Rename HeaderUtils methods
I'd like to propose to rename some methods of
HeaderUtils
before Symfony 4.1 is released.split()
I don't like that name because PHP removed the
split()
function in PHP 7.0. Could we rename it toexplode()
to be inline with modern PHP naming?combineParts()
I wonder if
combine()
would be enough. Maybe not. It's just that this method name is not "symmetrical" tosplit()
(which should be calledsplitParts()
then).joinAssoc()
This is the method name I like the least. I've looked up in the "Header Fields" section of HTTP standard (https://tools.ietf.org/html/rfc7230#section-3.2) but there's no terminology about headers that we could use here.
I've looked up in other frameworks and I haven't found much. Spring for example calls this
toCommaDelimitedString()
The problem I see with
joinAssoc()
name is that it explains the low level details of how it works (joining associative arrays into a single string). I'd prefer a method that describes what it does:stringify()
,toString()
,asString()
, etc.The text was updated successfully, but these errors were encountered: