-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[HttpFoundation] deprecated finding deep items in Request
and ParameterBag
#14203
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
xabbuh
commented
Apr 3, 2015
Q | A |
---|---|
Bug fix? | no |
New feature? | no |
BC breaks? | no |
Deprecations? | yes |
Tests pass? | yes |
Fixed tickets | |
License | MIT |
Doc PR | TODO |
f55c2af
to
64ec8b4
Compare
the Security component is relying on this feature IIRC |
Indeed, thanks for noticing. I check this. |
Big 👍 from me. @xabbuh Can you reference the original ticket here as well? |
64ec8b4
to
01cdfe4
Compare
I updated the Security component. Let's see what the tests say. |
IMO 3rdparty libs/frameworks rely on this feature. Maybe it makes sense at least to move RequestUtils to HttpFoundation? |
01cdfe4
to
73c783a
Compare
Libraries currently relying on this, will have time to update their code to deal with it when the breaking change will be done in 3.0.
I don't think that this would be a good idea. We would then have to maintain the code again (just not in the |
Remaining failures should be fixed with #14197 soon. |
public static function getDeepParameter(Request $request, $path) | ||
{ | ||
if (false === $pos = strpos($path, '[')) { | ||
return $request->get($path, null); |
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.
you can omit the second argument. It is already the default
Well, if the Security component needs it, it mean we cannot drop the logic entirely anyway. And given you moved it to a separate component, it even mean we have to maintain it twice for now, because the BC layer cannot reuse the RequestUtils class |
9eff960
to
a83a2da
Compare
You're right. I moved the utility class to the HttpFoundation component and removed the duplicated logic from the |
33b5708
to
26ba680
Compare
*/ | ||
public function get($key, $default = null, $deep = false) | ||
{ | ||
if (true === $deep) { |
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.
Isn't false !== $deep
more suitable for this check? Or even better, something like false !== $deep || func_num_args() > 2
to check if $deep
argument is passed regardless its value and avoiding the impact of calling a function when the value isn't the default one.
It's going to be in 2.8 for now. Sorry about that, but we don't merge anything new after the first beta, except fro "big" problems. |
26ba680
to
34e4e73
Compare
I think we should reconsider this again for Symfony 2.8 given that 2.7 is released now. ping @symfony/deciders |
@@ -99,54 +99,20 @@ public function add(array $parameters = array()) | |||
* @throws \InvalidArgumentException | |||
* | |||
* @api | |||
* | |||
* @deprecated Finding deep items is deprecated since version 2.7, to be removed in 3.0. |
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.
Since the method itself is not deprecated we should avoid using @deprecated
tag here.
I'm all in for deprecating this feature. |
34e4e73
to
57c3c24
Compare
In symfony#15973, the `searchResultsAction()` of the `ProfilerController` was updated to pass the current request to the rendered template. However, this change was not reflected in the test thus letting it fail.
…t (xabbuh) This PR was merged into the 2.8 branch. Discussion ---------- [WebProfilerBundle] reflect latest changes in test | Q | A | ------------- | --- | Bug fix? | yes | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | | License | MIT | Doc PR | In symfony#15973, the `searchResultsAction()` of the `ProfilerController` was updated to pass the current request to the rendered template. However, this change was not reflected in the test thus letting it fail. Commits ------- ae283e8 [WebProfilerBundle] reflect latest changes in test
…s (xabbuh) This PR was merged into the 2.8 branch. Discussion ---------- [Security] fix tests for the `AbstractVoter` class | Q | A | ------------- | --- | Bug fix? | yes | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | symfony#15961, symfony#15968 | License | MIT | Doc PR | * The `LegacyAbstractVoterTest` class is not needed anymore, tests have been moved to the `AbstractVoterTest` class tagging them with the legacy group. * Tests are applied on `stdClass` object instances. Thus, the legacy voter fixture class must not support `AbstractVoterTest_Object` instances, but support `stdClass` objects instead. * Remove a test that checked for a `BadMethodCallException` being thrown. This seems to have been added accidentally in symfony#15961. Commits ------- 9fe3b76 fix tests for the `AbstractVoter` class
…mand and apply Symfony styles (1ed) This PR was submitted for the 2.7 branch but it was merged into the 2.8 branch instead (closes symfony#14235). Discussion ---------- [FrameworkBundle] Refactored assets:install command and apply Symfony styles | Q | A | ------------- | --- | Bug fix? | yes | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | - | License | MIT | Doc PR | - Replaces symfony#13057      Commits ------- 8b7b251 [FrameworkBundle] Refactor assets:install command and apply SymfonyStyle
…ent (stof) This PR was merged into the 2.8 branch. Discussion ---------- Add a non-static API for the CssSelector component | Q | A | ------------- | --- | Bug fix? | no | New feature? | yes | BC breaks? | no | Deprecations? | yes | Tests pass? | yes | Fixed tickets | symfony#15850, symfony#8404 | License | MIT | Doc PR | todo This implements a non-static API for the CssSelector component. I decided to keep the static API too, as it is convenient when you just need a one-shot conversion (if you need lots of conversions, keeping a reference to the Converter and all its internal object graph may be faster than releasing it all the time and rebuilding it). I deprecated the global state to choose between HTML and XML conversion. The static API would always enable the HTML extension in 3.0. Dealing with XML would be done by using the Converter class. A second commit also tags all internal classes of the component as ``@internal``, as there is really no reason for a user to deal with them (btw, we already considered them fully internal in the past, as we broke BC on them in a patch release to fix memory performance of the component in the past). TODOs: - [x] Validate whether we keep the static facade to the component - [ ] send a PR on the documentation to document this new API. - [x] handle usage of the deprecated API in the DomCrawler testsuite The DomCrawler component does not use the new API yet. I will do it in a separate PR, as distinguishing between HTML and XML modes for a crawler will be easier once I deprecate the possibility to load multiple documents (which I will do tomorrow). Commits ------- 9e51279 [CssSelector] Tag all internal classes as internal ones f4563c3 Add a non-static API for the CssSelector component
…constraint (enumag) This PR was submitted for the 2.3 branch but it was merged into the 2.8 branch instead (closes symfony#15919). Discussion ---------- [Form] Guess currency field based on validator constraint | Q | A | ------------- | --- | Bug fix? | yes | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | | License | MIT | Doc PR | Commits ------- 2993b00 [Form] Guess currency field based on validator constraint
This PR was squashed before being merged into the 2.8 branch (closes symfony#15964). Discussion ---------- Symfony Console Style tweaks | Q | A | ------------- | --- | Bug fix? | yes | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | - | License | MIT | Doc PR | - This PR will contain some minor tweaks found while updating all the Symfony commands. Don't merge yet. Thanks! Commits ------- 64e7b6f Symfony Console Style tweaks
…ands (javiereguiluz) This PR was squashed before being merged into the 2.8 branch (closes symfony#15972). Discussion ---------- [Console] Updated the styles of the server commands | Q | A | ------------- | --- | Bug fix? | no | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | - | License | MIT | Doc PR | - This PR uses `comment()` which hasn't been merged yet. WIP PR at symfony#15964   Commits ------- 4e2cc0f [Console] Updated the styles of the server commands
…reguiluz) This PR was merged into the 2.8 branch. Discussion ---------- Updated the styles of the cache commands | Q | A | ------------- | --- | Bug fix? | no | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | - | License | MIT | Doc PR | - This PR uses comment() which hasn't been merged yet. WIP PR at symfony#15964    Commits ------- 44c5416 Updated the styles for the "cache:warmup" command 08b2959 Updated the style for the "cache:clear" command
…buh) This PR was merged into the 2.8 branch. Discussion ---------- [Ldap] add some missing license file headers | Q | A | ------------- | --- | Bug fix? | no | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | symfony#14602 (comment) | License | MIT | Doc PR | Commits ------- 2b90fcf [Ldap] add some missing license file headers
This PR was merged into the 2.8 branch. Discussion ---------- add replace rule for new Ldap component | Q | A | ------------- | --- | Bug fix? | yes | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | | License | MIT | Doc PR | Commits ------- 1aa884c add replace rule for new Ldap component
Conflicts: src/Symfony/Component/Console/Application.php src/Symfony/Component/Console/Command/Command.php src/Symfony/Component/Console/Formatter/OutputFormatter.php src/Symfony/Component/Console/Formatter/OutputFormatterStyle.php src/Symfony/Component/Console/Input/Input.php src/Symfony/Component/Console/Input/InputArgument.php src/Symfony/Component/Console/Input/InputDefinition.php src/Symfony/Component/Console/Input/InputOption.php src/Symfony/Component/Console/Output/OutputInterface.php src/Symfony/Component/Console/Output/StreamOutput.php src/Symfony/Component/CssSelector/CssSelector.php src/Symfony/Component/DependencyInjection/Container.php src/Symfony/Component/DependencyInjection/ContainerBuilder.php src/Symfony/Component/DependencyInjection/ContainerInterface.php src/Symfony/Component/DependencyInjection/Definition.php src/Symfony/Component/DependencyInjection/Scope.php src/Symfony/Component/DependencyInjection/ScopeInterface.php src/Symfony/Component/Validator/Constraints/Currency.php src/Symfony/Component/Validator/Constraints/CurrencyValidator.php
322fddb
to
f128f5a
Compare
f128f5a
to
03ff6cb
Compare
see #16007 |
…st parameters (xabbuh) This PR was merged into the 2.8 branch. Discussion ---------- [HttpFoundation] deprecate finding deep items in request parameters | Q | A | ------------- | --- | Bug fix? | no | New feature? | no | BC breaks? | no | Deprecations? | yes | Tests pass? | yes | Fixed tickets | | License | MIT | Doc PR | This is the same as #14203 but using the PropertyAccess component in the Security HTTP component to query nested request parameters and is rebased on the `2.8` branch. Commits ------- 47fba88 deprecate finding deep items in request parameters