laravel / pint

Laravel Pint is an opinionated PHP code style fixer for minimalists.

Home Page:https://laravel.com/docs/pint

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Separate Trait Imports

billriess opened this issue · comments

Is it possible to separate the imports for traits? I couldn't find an option for this in php-cs-fixer but it may exist. Ideally, it would handle it similar to regular imports, one per Use statement.

We are not sure. You can search here: https://mlocati.github.io/php-cs-fixer-configurator/.

In case anyone is looking for the rule, you need to add this to your pint.json configuration to achieve this:

{
    "single_trait_insert_per_statement": true
}

Thanks! Shouldn't this be default for PINT as it's a PSR-12 standard?

https://www.php-fig.org/psr/psr-12/#42-using-traits

@billriess the default for Laravel is the Laravel preset, not the PSR-12 one.