Skip to content

Commit e200a26

Browse files
committed
Do not add for internal class
1 parent 3c65a86 commit e200a26

File tree

3 files changed

+14
-4
lines changed

3 files changed

+14
-4
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
[![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)
66
[![PHP version](https://img.shields.io/packagist/php-v/kubawerlos/php-cs-fixer-custom-fixers.svg)](https://php.net)
77
[![License](https://img.shields.io/github/license/kubawerlos/php-cs-fixer-custom-fixers.svg)](LICENSE)
8-
![Tests](https://img.shields.io/badge/tests-3787-brightgreen.svg)
8+
![Tests](https://img.shields.io/badge/tests-3788-brightgreen.svg)
99
[![Downloads](https://img.shields.io/packagist/dt/kubawerlos/php-cs-fixer-custom-fixers.svg)](https://packagist.org/packages/kubawerlos/php-cs-fixer-custom-fixers)
1010

1111
[![CI status](https://github.com/kubawerlos/php-cs-fixer-custom-fixers/actions/workflows/ci.yaml/badge.svg)](https://github.com/kubawerlos/php-cs-fixer-custom-fixers/actions/workflows/ci.yaml)

src/Fixer/PhpdocTagNoNamedArgumentsFixer.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,7 @@ private function ensureIsDocBlockWithNoNameArgumentsTag(Tokens $tokens, int $ind
158158
static function (WhitespacesFixerConfig $whitespacesConfig, Tokens $tokens, int $index): void {
159159
$phpUnitInternalClassFixer = new PhpUnitInternalClassFixer();
160160
$phpUnitInternalClassFixer->setWhitespacesConfig($whitespacesConfig);
161-
$phpUnitInternalClassFixer->ensureIsDocBlockWithAnnotation($tokens, $index, 'no-named-arguments', ['no-named-arguments'], []);
161+
$phpUnitInternalClassFixer->ensureIsDocBlockWithAnnotation($tokens, $index, 'no-named-arguments', ['internal', 'no-named-arguments'], []);
162162
},
163163
null,
164164
PhpUnitInternalClassFixer::class,

tests/Fixer/PhpdocTagNoNamedArgumentsFixerTest.php

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,14 +63,14 @@ public function testFix(string $expected, ?string $input = null, array $configur
6363
*/
6464
public static function provideFixCases(): iterable
6565
{
66-
yield 'do not touch anonymous class' => [
66+
yield 'do not add for anonymous class' => [
6767
<<<'PHP'
6868
<?php
6969
new class () {};
7070
PHP,
7171
];
7272

73-
yield 'do not touch for different directory' => [
73+
yield 'do not add for different directory' => [
7474
<<<'PHP'
7575
<?php
7676
class Foo {}
@@ -79,6 +79,16 @@ class Foo {}
7979
['directory' => __DIR__ . '/../../src/Fixer'],
8080
];
8181

82+
yield 'do not add for internal class' => [
83+
<<<'PHP'
84+
<?php
85+
/**
86+
* @internal
87+
*/
88+
class Foo {}
89+
PHP,
90+
];
91+
8292
yield 'create PHPDoc comment' => [
8393
<<<'PHP'
8494
<?php

0 commit comments

Comments
 (0)