Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Fixed a redundant check in DefaultValueResolver #18575

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
Apr 28, 2016
Merged

Fixed a redundant check in DefaultValueResolver #18575

merged 1 commit into from
Apr 28, 2016

Conversation

linaori
Copy link
Contributor

@linaori linaori commented Apr 18, 2016

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

In #18308 I have introduced a DefaultValueResolver. When writing documentation, I was planning on adding the code as an example and I noticed it did a check in the request attributes. A default value value should always be injected, whether the request has it or not. In case the request does have the value, it would've already been added and thus never reach the default resolver.

Thus as this is never called in the default and configured flows and should not change the default value behavior, I'm removing this.

@Koc
Copy link
Contributor

Koc commented Apr 18, 2016

Heh, you answered on my question here #18308 (comment)

@linaori
Copy link
Contributor Author

linaori commented Apr 18, 2016

@Koc correct, back when I answered it, the sequences weren't that robust. Now that the ArgumentResolver creates the objects when not passed along, it's guaranteed that the default sequence will not cause this issue. Previously only with the FrameworkBundle this could be guaranteed.

So your comment was indeed correct, but ahead of time 👍

@fabpot
Copy link
Member

fabpot commented Apr 28, 2016

Thank you @iltar.

@fabpot fabpot merged commit e54c1a6 into symfony:master Apr 28, 2016
fabpot added a commit that referenced this pull request Apr 28, 2016
This PR was merged into the 3.1-dev branch.

Discussion
----------

Fixed a redundant check in DefaultValueResolver

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

In #18308 I have introduced a `DefaultValueResolver`. When writing documentation, I was planning on adding the code as an example and I noticed it did a check in the request attributes. A default value value should always be injected, whether the request has it or not. In case the request _does_ have the value, it would've already been added and thus never reach the default resolver.

Thus as this is never called in the default and configured flows and should not change the default value behavior, I'm removing this.

Commits
-------

e54c1a6 Fixed a redundant check in DefaultValueResolver
@linaori linaori deleted the fix/default-value-resolver branch February 8, 2019 13:38
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