Skip to content

Commit 14f9c9d

Browse files
clxmstaabnikic
authored andcommitted
Use more precise list-types for getter methods
1 parent fa02db3 commit 14f9c9d

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

lib/PhpParser/Node/Stmt/ClassLike.php

+4-4
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ abstract class ClassLike extends Node\Stmt {
1717
public ?Node\Name $namespacedName;
1818

1919
/**
20-
* @return TraitUse[]
20+
* @return list<TraitUse>
2121
*/
2222
public function getTraitUses(): array {
2323
$traitUses = [];
@@ -30,7 +30,7 @@ public function getTraitUses(): array {
3030
}
3131

3232
/**
33-
* @return ClassConst[]
33+
* @return list<ClassConst>
3434
*/
3535
public function getConstants(): array {
3636
$constants = [];
@@ -43,7 +43,7 @@ public function getConstants(): array {
4343
}
4444

4545
/**
46-
* @return Property[]
46+
* @return list<Property>
4747
*/
4848
public function getProperties(): array {
4949
$properties = [];
@@ -78,7 +78,7 @@ public function getProperty(string $name): ?Property {
7878
/**
7979
* Gets all methods defined directly in this class/interface/trait
8080
*
81-
* @return ClassMethod[]
81+
* @return list<ClassMethod>
8282
*/
8383
public function getMethods(): array {
8484
$methods = [];

lib/PhpParser/NodeVisitor/FindingVisitor.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
class FindingVisitor extends NodeVisitorAbstract {
1313
/** @var callable Filter callback */
1414
protected $filterCallback;
15-
/** @var Node[] Found nodes */
15+
/** @var list<Node> Found nodes */
1616
protected array $foundNodes;
1717

1818
public function __construct(callable $filterCallback) {
@@ -24,7 +24,7 @@ public function __construct(callable $filterCallback) {
2424
*
2525
* Nodes are returned in pre-order.
2626
*
27-
* @return Node[] Found nodes
27+
* @return list<Node> Found nodes
2828
*/
2929
public function getFoundNodes(): array {
3030
return $this->foundNodes;

0 commit comments

Comments
 (0)