Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

align_multiline_parameters produces new line for promoted properties without any types. #8

Closed
nizacegodk opened this issue Jan 9, 2024 · 2 comments
Assignees
Labels
bug Something isn't working

Comments

@nizacegodk
Copy link

When using 'ErickSkrauch/align_multiline_parameters' => ['variables' => true] we get an unexpected style fixing for classes with promoted properties without a type:

Before:

/**
 * @template T
 */
class Diff
{
    /**
     * @param T $was
     * @param T $expected
     */
    public function __construct(
        public $was,
        public $expected,
    ) {
    }
}

After:

/**
 * @template T
 */
class Diff
{
    /**
     * @param T $was
     * @param T $expected
     */
    public function __construct(
        public
        $was,
        public
        $expected,
    ) {
    }
}

Expected (No change):

/**
 * @template T
 */
class Diff
{
    /**
     * @param T $was
     * @param T $expected
     */
    public function __construct(
        public $was,
        public $expected,
    ) {
    }
}
@erickskrauch erickskrauch added the bug Something isn't working label Jan 9, 2024
@erickskrauch
Copy link
Owner

For some reason, I thought property promotion was impossible without specifying a type. But I double-checked and no, the type is optional. There is definitely an error here. I will fix it soon.

@erickskrauch erickskrauch self-assigned this Jan 9, 2024
@erickskrauch
Copy link
Owner

@nizacegodk, released in 1.2.3. Thank you for the issue!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants