You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Because it's using anonymous classes, my dumper doesn't have anything to provide during getProxyCode(). But if it returns an empty string, PhpDumper crashes with the following message:
Fatal error: Uncaught ErrorException: Undefined offset: 1 in /app/vendor/symfony/dependency-injection/Dumper/PhpDumper.php:381
This PR was merged into the 2.8 branch.
Discussion
----------
[DependencyInjection] Skip empty proxy code
| Q | A
| ------------- | ---
| Branch? | 4.1
| Bug fix? | yes
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | #28852
| License | MIT
Fix#28852@nicolas-grekas I'm not sure which branch this should be applied to, please let me know.
Commits
-------
baf6f8c Skip empty proxy code
Symfony version(s) affected: 4.1.x (maybe older versions too)
Description
PhpDumper
crashes ifDumperInterface::getProxyCode()
returns an empty string.How to reproduce
I'm writing a proxy dumper that leverages anonymous classes to produce code similar to the following example:
Because it's using anonymous classes, my dumper doesn't have anything to provide during
getProxyCode()
. But if it returns an empty string,PhpDumper
crashes with the following message:That's because of the following code:
As a workaround, I need to define
getProxyCode()
as follows, which is not ideal:Possible Solution
To fix the problem we could have the following code:
The text was updated successfully, but these errors were encountered: