Skip to content

Commit e793146

Browse files
authored
Add priority between_ hpdocTypesTrimFixer and NoSuperfluousPhpdocTagsFixer (#577)
1 parent 287fdbe commit e793146

File tree

4 files changed

+20
-4
lines changed

4 files changed

+20
-4
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
[![Latest stable version](https://img.shields.io/packagist/v/kubawerlos/php-cs-fixer-custom-fixers.svg?label=current%20version)](https://packagist.org/packages/kubawerlos/php-cs-fixer-custom-fixers)
44
[![PHP version](https://img.shields.io/packagist/php-v/kubawerlos/php-cs-fixer-custom-fixers.svg)](https://php.net)
55
[![License](https://img.shields.io/github/license/kubawerlos/php-cs-fixer-custom-fixers.svg)](LICENSE)
6-
![Tests](https://img.shields.io/badge/tests-2830-brightgreen.svg)
6+
![Tests](https://img.shields.io/badge/tests-2833-brightgreen.svg)
77
[![Downloads](https://img.shields.io/packagist/dt/kubawerlos/php-cs-fixer-custom-fixers.svg)](https://packagist.org/packages/kubawerlos/php-cs-fixer-custom-fixers)
88

99
[![CI Status](https://github.com/kubawerlos/php-cs-fixer-custom-fixers/workflows/CI/badge.svg?branch=main&event=push)](https://github.com/kubawerlos/php-cs-fixer-custom-fixers/actions)

dev-tools/composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
"fix": [
3838
"@composer normalize --no-check-lock ../composer.json",
3939
"@composer normalize --no-check-lock",
40-
"./build-infection-config",
40+
"@php ./build-infection-config",
4141
"phpcbf || exit 0"
4242
],
4343
"infection": [

src/Fixer/PhpdocTypesTrimFixer.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,11 +38,11 @@ function foo($x) {}
3838
}
3939

4040
/**
41-
* Must run before PhpdocAlignFixer.
41+
* Must run before NoSuperfluousPhpdocTagsFixer, PhpdocAlignFixer.
4242
*/
4343
public function getPriority(): int
4444
{
45-
return 0;
45+
return 7;
4646
}
4747

4848
public function isCandidate(Tokens $tokens): bool

tests/PriorityTest.php

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -627,6 +627,22 @@ public function bar(): self
627627
',
628628
];
629629

630+
yield [
631+
new CustomFixer\PhpdocTypesTrimFixer(),
632+
new Fixer\Phpdoc\NoSuperfluousPhpdocTagsFixer(),
633+
'<?php
634+
/**
635+
*/
636+
function f(): ?string {}
637+
',
638+
'<?php
639+
/**
640+
* @return string | null
641+
*/
642+
function f(): ?string {}
643+
',
644+
];
645+
630646
yield [
631647
new CustomFixer\PhpdocTypesTrimFixer(),
632648
new Fixer\Phpdoc\PhpdocAlignFixer(),

0 commit comments

Comments
 (0)