laravel / pint

Laravel Pint is an opinionated PHP code style fixer for minimalists.
https://laravel.com/docs/pint
MIT License
2.75k stars 138 forks source link

Internal class pint rule is being overridden by Final class rule #266

Closed adam-code-labx closed 4 months ago

adam-code-labx commented 4 months ago

Pint Version

1.15.1

PHP Version

8.3

Description

"final_class": true,
"final_internal_class": false,

Using the following pint rules I would expect classes marked by @internal would be ignored https://laravel-news.com/configuring-laravel-pint#content-final-internal-class

Steps To Reproduce

final class FilamentTestCase extends TestCase
{
    protected function getEnvironmentSetUp($app): void
    {
        parent::getEnvironmentSetUp($app);
    }
}

PhpStorm for example recognises the @intenal parent CleanShot 2024-04-17 at 18 23 32@2x

TestCase should not be final as I have added @internal CleanShot 2024-04-17 at 18 25 29@2x

After formatting with pint it prepends final CleanShot 2024-04-17 at 18 26 31@2x

Expected behaviour here is final_internal_class should override the final_class rule. Or perhaps I am missing something here?

driesvints commented 4 months ago

Hi there. This isn't something Pint can help with since it's a PHP CS Fixer behaviour so please report this to their repo, thanks.