Skip to content
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

[Config][ReflectionClassResource] Handle parameters with undefined constant as their default values #34560

Merged

Conversation

fancyweb
Copy link
Contributor

Q A
Branch? 3.4
Bug fix? yes
New feature? no
Deprecations? no
Tickets #34053
License MIT
Doc PR -

Basically we can fix this bug by "reimplementing" php src way of building the __toString() of the method except that we avoid to call the undefined constant. Obviously we cannot invalidate the resource if the value of the constant changes since we never knew it. However, it's still better than now.

@nicolas-grekas
Copy link
Member

Some tests fail, but this looks promising!

@fancyweb fancyweb force-pushed the config-reflection-class-undef-constant branch 3 times, most recently from 4dbcaa4 to ab35a71 Compare November 29, 2019 09:36
@fancyweb
Copy link
Contributor Author

I fixed the code for PHP <= 7.0.

@fancyweb fancyweb force-pushed the config-reflection-class-undef-constant branch 2 times, most recently from 13231fc to b955f83 Compare November 29, 2019 15:45
@fancyweb fancyweb force-pushed the config-reflection-class-undef-constant branch from b955f83 to 8de2a22 Compare November 29, 2019 16:04
@nicolas-grekas
Copy link
Member

Thank you @fancyweb.

nicolas-grekas added a commit that referenced this pull request Nov 29, 2019
…ndefined constant as their default values (fancyweb)

This PR was merged into the 3.4 branch.

Discussion
----------

[Config][ReflectionClassResource] Handle parameters with undefined constant as their default values

| Q             | A
| ------------- | ---
| Branch?       | 3.4
| Bug fix?      | yes
| New feature?  | no
| Deprecations? | no
| Tickets       | #34053
| License       | MIT
| Doc PR        | -

Basically we can fix this bug by "reimplementing" php src way of building the __toString() of the method except that we avoid to call the undefined constant. Obviously we cannot invalidate the resource if the value of the constant changes since we never knew it. However, it's still better than now.

Commits
-------

8de2a22 [Config][ReflectionClassResource] Handle parameters with undefined constant as their default values
@nicolas-grekas nicolas-grekas merged commit 8de2a22 into symfony:3.4 Nov 29, 2019
@fancyweb fancyweb deleted the config-reflection-class-undef-constant branch November 29, 2019 16:06
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.

None yet

4 participants