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

ProxyFactory may generate invalid proxies with no error #770

Closed
theofidry opened this issue Feb 3, 2017 · 3 comments
Closed

ProxyFactory may generate invalid proxies with no error #770

theofidry opened this issue Feb 3, 2017 · 3 comments
Assignees
Milestone

Comments

@theofidry
Copy link

Follow up of symfony/symfony#21509

If for example the entity is final, as the generated proxy make use of inheritance, this throw a FatalError when the proxy class is being used. However, this error is thrown at runtime when the proxy is being used, not when it is generated. WDYT of adding a simple include_once on the generated proxy when creating it, to throw an error as early as possible?

@theofidry theofidry changed the title ProxyFactory generates invalid proxies with no error ProxyFactory may generate invalid proxies with no error Feb 3, 2017
@Ocramius
Copy link
Member

Ocramius commented Feb 3, 2017 via email

@theofidry
Copy link
Author

The only case I've ever encountered the issue is when dealing with final classes, but I don't know and I suspect there is other cases as well where including the file ensures the generated PHP code is valid.

That said I'm fine with just doing a PR for the final case.

@Ocramius
Copy link
Member

Ocramius commented Feb 4, 2017

Fixed via #771

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants