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

Fix: Disable incorrectly behaving PhpdocAlignFixer for multiline descriptions #109

Merged
merged 2 commits into from
Jun 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion ecs.php
Original file line number Diff line number Diff line change
Expand Up @@ -522,7 +522,8 @@
'remove_inheritdoc' => true, // remove @inheritDoc tags
])
// All items of the given PHPDoc tags must be left-aligned.
->withConfiguredRule(PhpdocAlignFixer::class, ['align' => 'left'])
// @TODO: Re-enable if https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/issues/8052 is fixed
//->withConfiguredRule(PhpdocAlignFixer::class, ['align' => 'left'])
// Annotations in PHPDoc should be ordered in defined sequence.
->withConfiguredRule(PhpdocOrderFixer::class, ['order' => ['param', 'return', 'throws']])
// Order phpdoc tags by value.
Expand Down
4 changes: 3 additions & 1 deletion tests/Integration/Fixtures/PhpDoc.correct.php.inc
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,9 @@ class PhpDoc
* and possibly other Phpdoc rules.
*
* @param int|float $second Second parameter does have a comment, unlike the first one.
* @param string|null $third Third parameter is optional and has a default value.
* @param string|null $third Third parameter is optional and has a default value and multilne comment. Lorem
* ipsum dolor sit amet, consectetur adipiscing elit. Nullam nec purus nec nunc ultricies ultricies.
* Nullam nec purus nec nunc ultricies ultricies. Nullam nec purus nec nunc ultricies ultricies.
* @return mixed There is also information about return type.
* @throws \Exception
*/
Expand Down
12 changes: 7 additions & 5 deletions tests/Integration/Fixtures/PhpDoc.wrong.php.inc
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,13 @@ class PhpDoc
*
*
*
* @param string $first
* @throws \Exception
* @param int|float $second Second parameter does have a comment, unlike the first one.
* @param string|null $third Third parameter is optional and has a default value.
* @return mixed There is also information about return type.
* @param string $first
* @throws \Exception
* @param int|float $second Second parameter does have a comment, unlike the first one.
* @param string|null $third Third parameter is optional and has a default value and multilne comment. Lorem
* ipsum dolor sit amet, consectetur adipiscing elit. Nullam nec purus nec nunc ultricies ultricies.
* Nullam nec purus nec nunc ultricies ultricies. Nullam nec purus nec nunc ultricies ultricies.
* @return mixed There is also information about return type.
*/
public function veryWellDocumented(string $first, int|float $second, ?string $third = '3rd'): mixed
{
Expand Down
Loading