Skip to content

Commit b0eb3b7

Browse files
authored
Deprecate PhpdocTagNoNamedArgumentsFixer (#1087)
1 parent dfb7949 commit b0eb3b7

File tree

5 files changed

+22
-2
lines changed

5 files changed

+22
-2
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22

33
## v3.34.0
44
- Add PhpDocPropertySorterFixer
5+
- Deprecate PhpdocTagNoNamedArgumentsFixer - use "phpdoc_tag_no_named_arguments"
6+
- Update minimum PHP CS Fixer version to 3.87.0
57

68
## v3.33.0
79
- Update minimum PHP CS Fixer version to 3.86.0

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -643,6 +643,7 @@ The `@var` annotation must be on a single line if it is the only content.
643643

644644
#### PhpdocTagNoNamedArgumentsFixer
645645
There must be `@no-named-arguments` tag in PHPDoc of a class/enum/interface/trait.
646+
DEPRECATED: use `phpdoc_tag_no_named_arguments` instead.
646647
Configuration options:
647648
- `description` (`string`): description of the tag; defaults to `''`
648649
- `directory` (`string`): directory in which apply the changes, empty value will result with current working directory (result of `getcwd` call); defaults to `''`

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
"php": "^7.4 || ^8.0",
1414
"ext-filter": "*",
1515
"ext-tokenizer": "*",
16-
"friendsofphp/php-cs-fixer": "^3.86"
16+
"friendsofphp/php-cs-fixer": "^3.87"
1717
},
1818
"require-dev": {
1919
"phpunit/phpunit": "^9.6.24 || ^10.5.51 || ^11.5.32"

src/Fixer/PhpdocTagNoNamedArgumentsFixer.php

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@
1313

1414
use PhpCsFixer\ConfigurationException\InvalidFixerConfigurationException;
1515
use PhpCsFixer\Fixer\ConfigurableFixerInterface;
16+
use PhpCsFixer\Fixer\DeprecatedFixerInterface;
17+
use PhpCsFixer\Fixer\Phpdoc\PhpdocTagNoNamedArgumentsFixer as PTNNAFixer;
1618
use PhpCsFixer\Fixer\PhpUnit\PhpUnitInternalClassFixer;
1719
use PhpCsFixer\Fixer\WhitespacesAwareFixerInterface;
1820
use PhpCsFixer\FixerConfiguration\FixerConfigurationResolver;
@@ -32,19 +34,29 @@
3234
use PhpCsFixer\WhitespacesFixerConfig;
3335

3436
/**
37+
* @deprecated
38+
*
3539
* @implements ConfigurableFixerInterface<_InputConfig, _Config>
3640
*
3741
* @phpstan-type _InputConfig array{directory?: string, description?: string}
3842
* @phpstan-type _Config array{directory: string, description: string}
3943
*
4044
* @no-named-arguments
4145
*/
42-
final class PhpdocTagNoNamedArgumentsFixer extends AbstractFixer implements ConfigurableFixerInterface, WhitespacesAwareFixerInterface
46+
final class PhpdocTagNoNamedArgumentsFixer extends AbstractFixer implements ConfigurableFixerInterface, DeprecatedFixerInterface, WhitespacesAwareFixerInterface
4347
{
4448
private string $description = '';
4549
private string $directory = '';
4650
private WhitespacesFixerConfig $whitespacesConfig;
4751

52+
/**
53+
* @return list<string>
54+
*/
55+
public function getSuccessorsNames(): array
56+
{
57+
return [(new PTNNAFixer())->getName()];
58+
}
59+
4860
public function setWhitespacesConfig(WhitespacesFixerConfig $config): void
4961
{
5062
$this->whitespacesConfig = $config;

tests/Fixer/PhpdocTagNoNamedArgumentsFixerTest.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,11 @@ public function testIsRisky(): void
4848
self::assertRiskiness(false);
4949
}
5050

51+
public function testSuccessorName(): void
52+
{
53+
self::assertSuccessorName('phpdoc_tag_no_named_arguments');
54+
}
55+
5156
/**
5257
* @param array<string, int> $configuration
5358
*

0 commit comments

Comments
 (0)