Skip to content

LineLengthFixer doesn't shorten constructor with property promotion #74

@simoheinonen

Description

@simoheinonen

With

    ->withConfiguredRule(
        LineLengthFixer::class,
        [
            'line_length' => 120,
            'break_long_lines' => true,
            'inline_short_lines' => true,
        ]
    )

Doesn't work

<?php

class Foo
{
    public function __construct(
        private stdClass $foo,
    ) {}
}

[OK] No errors found. Great job - your code is shiny in style!

Works

<?php

class Foo
{
    public function __construct(
        stdClass $foo,
    ) {}
}
-    public function __construct(
-        stdClass $foo,
-    ) {}
+    public function __construct(stdClass $foo,) {}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions