PHPDoc comment formating and align differs if an PHP attribute exists
Hi !
We have auto format at file saving and we massively use Ctrl + Alt + L command
But in classes __construct() we have strange formatting on PHPDoc comments:

Code sample:
public function __construct(
#[Foo]
/** @var foo */
public ?Foo $jsonConfiguration,
public ?array $foo,
#[Assert\Valid]
/** @var foo */
public ?array $foo2,
public ?Foo $jsonConfiguration2,
/** @var foo */
public ?array $foo3,
public ?Foo $jsonConfiguration3,
) {}If the comment declaration has an attribute before, the comment is aligned on the variable which is at the rightest position
If we don't have an attribute before, the comment is aligned to the left
Upload id for diagnostic data: 2026_03_06_9gKawzN5UsiheQk6PKprAx (file: phpstorm-logs-20260306-17530010519569022805937872.zip)
It is not .editorconfig related (occurs even if the .editorconfig file is deleted)
Thanks !
Please sign in to leave a comment.
Hello Samy Rabih,
Thank you for reporting!
I've reproduced this behavior and filed an issue at WI-84187. Please upvote it to get notified about the updates.