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

Support for PER Coding Style 2.0 #155

Closed taka-oyama closed 7 months ago

taka-oyama commented 7 months ago

We use php-cs-fixer to format out code to be aligned with PER coding style.

This library comes close by supporting PSR-12 but there are some minor differences.

One in particular that we've encountered is how multi-line methods are formatted.

PSR-12 output the below

    public function add(
        ?string $id,
    ): void
    {

but PER wants it to be like this.

    public function add(
        ?string $id,
    ): void {

We get diffs in our git everytime we generate the new code and it's very cumbersome.

Would it be possible to add support for this?

Btw, thanks for creating this great library. We use it in almost all our projects and is a joy to use.

taka-oyama commented 7 months ago

Actually, I was wrong... PSR-12 and PER's formatting is the same. So I guess the formatting is just incorrect.

taka-oyama commented 7 months ago

Thank you for the fix.