Skip to content
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
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

## v3.34.0
- Add PhpDocPropertySorterFixer
- Deprecate PhpdocTagNoNamedArgumentsFixer - use "phpdoc_tag_no_named_arguments"
- Update minimum PHP CS Fixer version to 3.87.0

## v3.33.0
- Update minimum PHP CS Fixer version to 3.86.0
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -643,6 +643,7 @@ The `@var` annotation must be on a single line if it is the only content.

#### PhpdocTagNoNamedArgumentsFixer
There must be `@no-named-arguments` tag in PHPDoc of a class/enum/interface/trait.
DEPRECATED: use `phpdoc_tag_no_named_arguments` instead.
Configuration options:
- `description` (`string`): description of the tag; defaults to `''`
- `directory` (`string`): directory in which apply the changes, empty value will result with current working directory (result of `getcwd` call); defaults to `''`
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"php": "^7.4 || ^8.0",
"ext-filter": "*",
"ext-tokenizer": "*",
"friendsofphp/php-cs-fixer": "^3.86"
"friendsofphp/php-cs-fixer": "^3.87"
},
"require-dev": {
"phpunit/phpunit": "^9.6.24 || ^10.5.51 || ^11.5.32"
Expand Down
14 changes: 13 additions & 1 deletion src/Fixer/PhpdocTagNoNamedArgumentsFixer.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@

use PhpCsFixer\ConfigurationException\InvalidFixerConfigurationException;
use PhpCsFixer\Fixer\ConfigurableFixerInterface;
use PhpCsFixer\Fixer\DeprecatedFixerInterface;
use PhpCsFixer\Fixer\Phpdoc\PhpdocTagNoNamedArgumentsFixer as PTNNAFixer;
use PhpCsFixer\Fixer\PhpUnit\PhpUnitInternalClassFixer;
use PhpCsFixer\Fixer\WhitespacesAwareFixerInterface;
use PhpCsFixer\FixerConfiguration\FixerConfigurationResolver;
Expand All @@ -32,19 +34,29 @@
use PhpCsFixer\WhitespacesFixerConfig;

/**
* @deprecated
*
* @implements ConfigurableFixerInterface<_InputConfig, _Config>
*
* @phpstan-type _InputConfig array{directory?: string, description?: string}
* @phpstan-type _Config array{directory: string, description: string}
*
* @no-named-arguments
*/
final class PhpdocTagNoNamedArgumentsFixer extends AbstractFixer implements ConfigurableFixerInterface, WhitespacesAwareFixerInterface
final class PhpdocTagNoNamedArgumentsFixer extends AbstractFixer implements ConfigurableFixerInterface, DeprecatedFixerInterface, WhitespacesAwareFixerInterface
{
private string $description = '';
private string $directory = '';
private WhitespacesFixerConfig $whitespacesConfig;

/**
* @return list<string>
*/
public function getSuccessorsNames(): array
{
return [(new PTNNAFixer())->getName()];
}

public function setWhitespacesConfig(WhitespacesFixerConfig $config): void
{
$this->whitespacesConfig = $config;
Expand Down
5 changes: 5 additions & 0 deletions tests/Fixer/PhpdocTagNoNamedArgumentsFixerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,11 @@ public function testIsRisky(): void
self::assertRiskiness(false);
}

public function testSuccessorName(): void
{
self::assertSuccessorName('phpdoc_tag_no_named_arguments');
}

/**
* @param array<string, int> $configuration
*
Expand Down
Loading