nette / php-generator

🐘 Generates neat PHP code for you. Supports new PHP 8.3 features.
https://doc.nette.org/php-generator
Other
2.11k stars 138 forks source link

Dumper: Fix dumping enums when in a namespace #88

Closed iggyvolz closed 3 years ago

iggyvolz commented 3 years ago

Dumped enums are missing a leading \, leading to issues when within a namespace (see test output without code fix - namespace will be ns1\ns2 rather than ns2).

Not sure if the latter lines of the test (with the attribute and eval()) belong in Dumper.dump().enum.phpt, a new test, or if it's even necessary - simply placing the test in a namespace is enough to catch the bug.

dg commented 3 years ago

Oh, fixed