Skip to content

Commit 3c000f2

Browse files
Rename
1 parent 39ae8d3 commit 3c000f2

File tree

5 files changed

+23
-23
lines changed

5 files changed

+23
-23
lines changed

src/Ast/PhpDoc/PhpDocNode.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -232,13 +232,13 @@ public function getRequireImplementsTagValues(string $tagName = '@phpstan-requir
232232
}
233233

234234
/**
235-
* @return InheritorsTagValueNode[]
235+
* @return SealedTagValueNode[]
236236
*/
237-
public function getInheritorsTagValues(string $tagName = '@phpstan-inheritors'): array
237+
public function getSealedTagValues(string $tagName = '@phpstan-sealed'): array
238238
{
239239
return array_filter(
240240
array_column($this->getTagsByName($tagName), 'value'),
241-
static fn (PhpDocTagValueNode $value): bool => $value instanceof InheritorsTagValueNode,
241+
static fn (PhpDocTagValueNode $value): bool => $value instanceof SealedTagValueNode,
242242
);
243243
}
244244

src/Ast/PhpDoc/InheritorsTagValueNode.php renamed to src/Ast/PhpDoc/SealedTagValueNode.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
use PHPStan\PhpDocParser\Ast\Type\TypeNode;
77
use function trim;
88

9-
class InheritorsTagValueNode implements PhpDocTagValueNode
9+
class SealedTagValueNode implements PhpDocTagValueNode
1010
{
1111

1212
use NodeAttributes;

src/Parser/PhpDocParser.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -404,8 +404,8 @@ public function parseTagValue(TokenIterator $tokens, string $tag): Ast\PhpDoc\Ph
404404
break;
405405

406406
case '@psalm-inheritors':
407-
case '@phpstan-inheritors':
408-
$tagValue = $this->parseInheritorsTagValue($tokens);
407+
case '@phpstan-sealed':
408+
$tagValue = $this->parseSealedTagValue($tokens);
409409
break;
410410

411411
case '@deprecated':
@@ -938,11 +938,11 @@ private function parseRequireImplementsTagValue(TokenIterator $tokens): Ast\PhpD
938938
return new Ast\PhpDoc\RequireImplementsTagValueNode($type, $description);
939939
}
940940

941-
private function parseInheritorsTagValue(TokenIterator $tokens): Ast\PhpDoc\InheritorsTagValueNode
941+
private function parseSealedTagValue(TokenIterator $tokens): Ast\PhpDoc\SealedTagValueNode
942942
{
943943
$type = $this->typeParser->parse($tokens);
944944
$description = $this->parseOptionalDescription($tokens, true);
945-
return new Ast\PhpDoc\InheritorsTagValueNode($type, $description);
945+
return new Ast\PhpDoc\SealedTagValueNode($type, $description);
946946
}
947947

948948
private function parseDeprecatedTagValue(TokenIterator $tokens): Ast\PhpDoc\DeprecatedTagValueNode

src/Printer/Printer.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
use PHPStan\PhpDocParser\Ast\PhpDoc\Doctrine\DoctrineTagValueNode;
1919
use PHPStan\PhpDocParser\Ast\PhpDoc\ExtendsTagValueNode;
2020
use PHPStan\PhpDocParser\Ast\PhpDoc\ImplementsTagValueNode;
21-
use PHPStan\PhpDocParser\Ast\PhpDoc\InheritorsTagValueNode;
21+
use PHPStan\PhpDocParser\Ast\PhpDoc\SealedTagValueNode;
2222
use PHPStan\PhpDocParser\Ast\PhpDoc\MethodTagValueNode;
2323
use PHPStan\PhpDocParser\Ast\PhpDoc\MethodTagValueParameterNode;
2424
use PHPStan\PhpDocParser\Ast\PhpDoc\MixinTagValueNode;
@@ -328,7 +328,7 @@ private function printTagValue(PhpDocTagValueNode $node): string
328328
$type = $this->printType($node->type);
329329
return trim("{$type} {$node->description}");
330330
}
331-
if ($node instanceof InheritorsTagValueNode) {
331+
if ($node instanceof SealedTagValueNode) {
332332
$type = $this->printType($node->type);
333333
return trim("{$type} {$node->description}");
334334
}

tests/PHPStan/Parser/PhpDocParserTest.php

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
use PHPStan\PhpDocParser\Ast\PhpDoc\ExtendsTagValueNode;
2626
use PHPStan\PhpDocParser\Ast\PhpDoc\GenericTagValueNode;
2727
use PHPStan\PhpDocParser\Ast\PhpDoc\ImplementsTagValueNode;
28-
use PHPStan\PhpDocParser\Ast\PhpDoc\InheritorsTagValueNode;
28+
use PHPStan\PhpDocParser\Ast\PhpDoc\SealedTagValueNode;
2929
use PHPStan\PhpDocParser\Ast\PhpDoc\InvalidTagValueNode;
3030
use PHPStan\PhpDocParser\Ast\PhpDoc\MethodTagValueNode;
3131
use PHPStan\PhpDocParser\Ast\PhpDoc\MethodTagValueParameterNode;
@@ -109,7 +109,7 @@ protected function setUp(): void
109109
* @dataProvider provideMixinTagsData
110110
* @dataProvider provideRequireExtendsTagsData
111111
* @dataProvider provideRequireImplementsTagsData
112-
* @dataProvider provideInheritorsTagsData
112+
* @dataProvider provideSealedTagsData
113113
* @dataProvider provideDeprecatedTagsData
114114
* @dataProvider providePropertyTagsData
115115
* @dataProvider provideMethodTagsData
@@ -2212,15 +2212,15 @@ public function provideRequireImplementsTagsData(): Iterator
22122212
];
22132213
}
22142214

2215-
public function provideInheritorsTagsData(): Iterator
2215+
public function provideSealedTagsData(): Iterator
22162216
{
22172217
yield [
22182218
'OK without description',
2219-
'/** @phpstan-inheritors Foo|Bar */',
2219+
'/** @phpstan-sealed Foo|Bar */',
22202220
new PhpDocNode([
22212221
new PhpDocTagNode(
2222-
'@phpstan-inheritors',
2223-
new InheritorsTagValueNode(
2222+
'@phpstan-sealed',
2223+
new SealedTagValueNode(
22242224
new IdentifierTypeNode('Foo|Bar'),
22252225
'',
22262226
),
@@ -2230,11 +2230,11 @@ public function provideInheritorsTagsData(): Iterator
22302230

22312231
yield [
22322232
'OK with description',
2233-
'/** @phpstan-inheritors Foo|Bar optional description */',
2233+
'/** @phpstan-sealed Foo|Bar optional description */',
22342234
new PhpDocNode([
22352235
new PhpDocTagNode(
2236-
'@phpstan-inheritors',
2237-
new InheritorsTagValueNode(
2236+
'@phpstan-sealed',
2237+
new SealedTagValueNode(
22382238
new IdentifierTypeNode('Foo|Bar'),
22392239
'optional description',
22402240
),
@@ -2248,7 +2248,7 @@ public function provideInheritorsTagsData(): Iterator
22482248
new PhpDocNode([
22492249
new PhpDocTagNode(
22502250
'@psalm-inheritors',
2251-
new InheritorsTagValueNode(
2251+
new SealedTagValueNode(
22522252
new IdentifierTypeNode('Foo|Bar'),
22532253
'optional description',
22542254
),
@@ -2258,16 +2258,16 @@ public function provideInheritorsTagsData(): Iterator
22582258

22592259
yield [
22602260
'invalid without type and description',
2261-
'/** @phpstan-inheritors */',
2261+
'/** @phpstan-sealed */',
22622262
new PhpDocNode([
22632263
new PhpDocTagNode(
2264-
'@phpstan-inheritors',
2264+
'@phpstan-sealed',
22652265
new InvalidTagValueNode(
22662266
'',
22672267
new ParserException(
22682268
'*/',
22692269
Lexer::TOKEN_CLOSE_PHPDOC,
2270-
24,
2270+
20,
22712271
Lexer::TOKEN_IDENTIFIER,
22722272
null,
22732273
1,

0 commit comments

Comments
 (0)