Skip to content

[HttpFoundation] Remove deprecated class method parameter #16629

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
merged 1 commit into from
Nov 27, 2015
Merged

[HttpFoundation] Remove deprecated class method parameter #16629

merged 1 commit into from
Nov 27, 2015

Conversation

belka-ew
Copy link
Contributor

Q A
Bug fix? yes
New feature? no
BC breaks? yes
Deprecations? yes
Tests pass? yes
Fixed tickets
License MIT
Doc PR

$deep argument in Symfony\Component\HttpFoundation\BagParameter::get was deprecated in 2.8 and removed in master, but it is still used in the code of the class (and in the filter() method)

@fabpot
Copy link
Member

fabpot commented Nov 23, 2015

Good catch. Can you first submit a PR on 2.8 to generate deprecation notices when a call to these methods uses $deep as true? Thanks.

@belka-ew
Copy link
Contributor Author

@fabpot I'll do it this Wednesday

@Tobion
Copy link
Contributor

Tobion commented Nov 23, 2015

I don't think we need deprecation message for those methods because it calls get internally which already creates a deprecation message.

But we need to trigger a deprecation message for filter and change the signature in 2.8 with BC layer. Even when calling filter with deep=false it must create a warning because it's in the middle of the parameters.

@belka-ew
Copy link
Contributor Author

@Tobion
Do you mean change the signature to

public function filter($key, $default = null, $filter = FILTER_DEFAULT, $options = array(), $deep = false)

but check if $filter is a boolean ($deep) or an integer (right $filter)?

@Tobion
Copy link
Contributor

Tobion commented Nov 23, 2015

Yes. Basically change the signature to the new one: public function filter($key, $default = null, $filter = FILTER_DEFAULT, $options = array()) And then check if $filter is a boolean. And if yes trigger deprecation, treat params like the old signature and use func_get_arg to get the last one.

@belka-ew
Copy link
Contributor Author

Sorry for the late response
See #16703

@nicolas-grekas
Copy link
Member

Will need to be rebased once #16706 is merged

@nicolas-grekas
Copy link
Member

Thank you @belka-ew.

@nicolas-grekas nicolas-grekas merged commit 4ffe14c into symfony:master Nov 27, 2015
nicolas-grekas added a commit that referenced this pull request Nov 27, 2015
…ter (belka-ew)

This PR was merged into the 3.0-dev branch.

Discussion
----------

[HttpFoundation] Remove deprecated class method parameter

| Q             | A
| ------------- | ---
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | yes
| Deprecations? | yes
| Tests pass?   | yes
| Fixed tickets |
| License       | MIT
| Doc PR        |

$deep argument in Symfony\Component\HttpFoundation\BagParameter::get was deprecated  in 2.8 and removed in master, but it is still used in the code of the class (and in the filter() method)

Commits
-------

4ffe14c [HttpFoundation] Remove deprecated class method parameter
@belka-ew belka-ew deleted the fix_deprecated_argument branch November 27, 2015 14:31
@fabpot fabpot mentioned this pull request Nov 30, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants