kokororin / vscode-phpfmt

Integrates phpfmt into VS Code
https://marketplace.visualstudio.com/items?itemName=kokororin.vscode-phpfmt
BSD 3-Clause "New" or "Revised" License
129 stars 30 forks source link

Attribute with parameter with [] array + following functions with "public" or "?" corrupt #131

Closed ili101 closed 7 months ago

ili101 commented 7 months ago
<?php

namespace App\Entity;

use Symfony\Component\Validator\Constraints\Ip;

class User
{
    private ?string $testP;

    #[Ip(groups: [])]
    public function test()
    {
    }
    private function test2()
    {
    }
    protected function test4()
    {
    }
    function test5()
    {
    }

    function testOut(): ?string
    {
        return $this->testP;
    }
}

After:

<?php

namespace App\Entity;

use Symfony\Component\Validator\Constraints\Ip;

class User
{
    private ?string $testP;

    #[Ip(groups: [])]
    function(){}function(){}function(){}function(){}function():{returnprotected ?string $this->testP;
    }
}

Expected no change

driade commented 7 months ago

Thanks a lot @ili101, this should be already fixed. May you please confirm?

ili101 commented 7 months ago

LGTM