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 support for trailling comma for method paramerts #106

Closed astronom closed 2 years ago

astronom commented 2 years ago

Since the last update trailing comma supports for constructor property promotion. Also support for arrays. But there is no support for method and function parameters.

See https://github.com/nette/php-generator/blob/master/src/PhpGenerator/Printer.php#L322 Var special is determined dynamically

Suggest to add some parameter to Printer and support trailing comma whether needed.

dg commented 2 years ago

Oh, that's a bug in the code, it was supposed to print trailing comma every time.

astronom commented 2 years ago

I instal the version with fix and it is working! But in dev-master now is trailing whitespace in comment... When are youg going to release?

dg commented 2 years ago

I tried to fix it, can you test it?

astronom commented 2 years ago

I suppose this will fix trailing whitespace in multiline comments https://github.com/nette/php-generator/pull/107