Skip to content

[HttpFoundation] Fix typo for ParameterBag getters #6278

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

Closed
wants to merge 3 commits into from
Closed
Changes from 1 commit
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
2 changes: 1 addition & 1 deletion components/http_foundation/introduction.rst
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ has some methods to filter the input values:
:method:`Symfony\\Component\\HttpFoundation\\ParameterBag::filter`
Filters the parameter by using the PHP :phpfunction:`filter_var` function.

All getters takes up to three arguments: the first one is the parameter name
All getters take up to two arguments: the first one is the parameter name
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well, in Symfony 2.7 you can still pass a third argument to perform a "deep search" (see the following paragraph). However, talking about only two parameters is true when it comes to Symfony 3.0.

Would you be able to make that change here and open another pull request for the 3.0 branch?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hello, @xabbuh!

Yep, you are right. I only checked against the 3.0 branch.
I will do a pull request against the 3.0 branch asap.

Thanks,
Denis

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@rendler-denis Changing "takes" to take" for all other branches indeed is right. So we can merge this one when you change back "two" to "three". :)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@xabbuh, I've reverted the 'two' to 'three' text and also added a description and example for the third argument. The example is based on the comment from the code and I haven't had time to check if it is 100% correct.
Let me know if it needs any further changes.
I will do a PR for the 3.0 branch in a few hours as well.

Thanks,
Denis

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the addition for the third parameter is not needed (there already is a paragraph below that explains why the argument is there). I also wouldn't want to add more details about a feature of which we know that it is not there anymore in newer Symfony versions.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So to be honest, I would rather favour to remove the description of that feature than to document it even more (but keeping it the way it is is okay for me too).

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@xabbuh, I see your point. I reverted the text to its original state plus removal of the unnecessary 's' character.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@xabbuh, I've also added a PR for the 3.0 branch. #6286

Thanks,
Denis

and the second one is the default value to return if the parameter does not
exist::

Expand Down