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

Add possibility to configure wrapping length of Dumper-class #56

Closed duxthefux closed 3 years ago

duxthefux commented 4 years ago

Closes #55

See #45 and #55

duxthefux commented 4 years ago

Please note that static getter and setter was added to force type safety

dg commented 4 years ago

Thanks for PR.

I have this thing on the TODO list. However, the solution is not so simple, because it is not possible to use static variables in Nette (because it follows the principles of dependency injection).

So this will be a little harder to solve. I'll leave it open so far.

duxthefux commented 4 years ago

hey @dg,

any update on this? As far as I can see it no dependency injection via nette container is used for the Dumper-class currently. So maybe it's not that tragic to use a static property now, as a lot of refactoring needs to be done anyways to get rid of calls like (new Dumper)->format($code, ...$args).

Happy to hear your opinion.

dg commented 3 years ago

Printer has new property $wrapLength