tighten / duster

Automatic configuration for Laravel apps to apply Tighten's standard linting & code standards.
MIT License
461 stars 13 forks source link

[HELP] Construct class #144

Closed abkrim closed 5 months ago

abkrim commented 5 months ago

Hello.

Sorry for this issue. Really is a help.

 public function __construct(
        public CoreProcess $coreProcess,
        public ?string $email = null,
        public ?string $emailCc = null,
        public ?string $emailBcc = null
    ) {

I don't see where is rule for this style.

When run duster fix, duster format to

 public function __construct(public CoreProcess $coreProcess, public ?string $email = null, public ?string $emailCc = null, public ?string $emailBcc = null)
    {

I like my style because I think is correct more legible (not more 80 columns)

Is possible?

I don't see the rule.

Best regards.

driftingly commented 5 months ago

Hi @abkrim,

When I run Duster against your example code I'm not getting the same long line result. Are you running the latest version? Do you have any existing configuration files in your repo for Pint, PHP_CodeSniffer, or PHP CS Fixer?

abkrim commented 5 months ago

Hi @driftingly

I'm using versions : * v2.7.4, and Laravel Framework 10.48.4

Andyes

pint

{
    "preset": "laravel",
    "exclude": [
        "database",
        "elk",
        "config",
        "notas",
        "vendor"
    ]
}

The others no.

driftingly commented 5 months ago

I haven't been able to reproduce this issue. The constructor is always left as multi-lined:

 public function __construct(
        public CoreProcess $coreProcess,
        public ?string $email = null,
        public ?string $emailCc = null,
        public ?string $emailBcc = null
    ) {

I think there's still some other rule getting picked up to change it.

abkrim commented 5 months ago

No problem. Uninstall duster.

I like it, but with Pint, although I didn't have duster's skills, I didn't have these problems.

When I have some time, I will try again. It is not primary.

Thanks for your time.