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

[ProxyManager] isProxyCandidate() does not take into account interfaces #31551

Merged
merged 1 commit into from May 20, 2019

Conversation

andrerom
Copy link
Contributor

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

When using factories it's common best practice to use interface as class name, especially in cases
where you know implementation can differ. Before this fix ProxyManager did not allow these to be lazy.

As we have have this issue on 2.8 and 3.4. it's very hard to debug, and goes against best practice for factories to not fix it, this is suggested for 2.8.

Copy link
Member

@nicolas-grekas nicolas-grekas left a comment

Choose a reason for hiding this comment

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

(but for 3.4 as 2.8 is EOLed)

…nterfaces

When using factories it's common best practice to use interface as class name, especially in cases
where you know impl can differ. Before this fix ProxyManager did not allow these to be lazy.

In our case this has lead several to hard to debug issues on classes we need to mark as lazyi
and often a need to add lazy on decorators if there are any or other workarounds.
As we have had this issue, and still have on both 2.8 and 3.4 this is opened against 2.8.
@andrerom andrerom changed the base branch from 2.8 to 3.4 May 20, 2019 11:04
@nicolas-grekas
Copy link
Member

Thank you @andrerom.

@nicolas-grekas nicolas-grekas merged commit e3739b1 into symfony:3.4 May 20, 2019
nicolas-grekas added a commit that referenced this pull request May 20, 2019
…nt interfaces (andrerom)

This PR was merged into the 3.4 branch.

Discussion
----------

[ProxyManager] isProxyCandidate() does not take into account interfaces

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

When using factories it's common best practice to use interface as class name, especially in cases
where you know implementation can differ. Before this fix ProxyManager did not allow these to be lazy.

As we have have this issue on 2.8 and 3.4. it's very hard to debug, and goes against best practice for factories to not fix it, this is suggested for 2.8.

Commits
-------

e3739b1 [Bridge\ProxyManager] isProxyCandidate() does not take into account interfaces
@andrerom andrerom deleted the lazy_interface branch May 20, 2019 13:23
This was referenced May 22, 2019
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