File tree Expand file tree Collapse file tree 8 files changed +24
-37
lines changed Expand file tree Collapse file tree 8 files changed +24
-37
lines changed Original file line number Diff line number Diff line change 2020 * Learn more: https://phpstan.org/developing-extensions/collectors
2121 *
2222 * @api
23- * @phpstan- template-covariant TNodeType of Node
24- * @phpstan- template-covariant TValue
23+ * @template-covariant TNodeType of Node
24+ * @template-covariant TValue
2525 */
2626interface Collector
2727{
2828
2929/**
30- * @phpstan- return class-string<TNodeType>
30+ * @return class-string<TNodeType>
3131 */
3232public function getNodeType (): string ;
3333
3434/**
35- * @phpstan- param TNodeType $node
35+ * @param TNodeType $node
3636 * @return TValue|null Collected data
3737 */
3838public function processNode (Node $ node , Scope $ scope );
Original file line number Diff line number Diff line change @@ -27,10 +27,8 @@ public function __construct(array $collectors)
2727
2828/**
2929 * @template TNodeType of Node
30- * @phpstan-param class-string<TNodeType> $nodeType
31- * @param Node $nodeType
32- * @phpstan-return array<Collector<TNodeType, mixed>>
33- * @return Collector[]
30+ * @param class-string<TNodeType> $nodeType
31+ * @return array<Collector<TNodeType, mixed>>
3432 */
3533public function getCollectors (string $ nodeType ): array
3634{
@@ -48,8 +46,7 @@ public function getCollectors(string $nodeType): array
4846}
4947
5048/**
51- * @phpstan-var array<Collector<TNodeType, mixed>> $selectedCollectors
52- * @var Collector[] $selectedCollectors
49+ * @var array<Collector<TNodeType, mixed>> $selectedCollectors
5350 */
5451$ selectedCollectors = $ this ->cache [$ nodeType ];
5552
Original file line number Diff line number Diff line change @@ -14,10 +14,9 @@ public function hasService(string $serviceName): bool;
1414public function getService (string $ serviceName );
1515
1616/**
17- * @phpstan-template T of object
18- * @phpstan-param class-string<T> $className
19- * @phpstan-return T
20- * @return mixed
17+ * @template T of object
18+ * @param class-string<T> $className
19+ * @return T
2120 */
2221public function getByType (string $ className );
2322
Original file line number Diff line number Diff line change @@ -32,10 +32,9 @@ public function getService(string $serviceName)
3232}
3333
3434/**
35- * @phpstan-template T of object
36- * @phpstan-param class-string<T> $className
37- * @phpstan-return T
38- * @return mixed
35+ * @template T of object
36+ * @param class-string<T> $className
37+ * @return T
3938 */
4039public function getByType (string $ className )
4140{
Original file line number Diff line number Diff line change @@ -30,10 +30,8 @@ public function __construct(array $rules)
3030
3131/**
3232 * @template TNodeType of Node
33- * @phpstan-param class-string<TNodeType> $nodeType
34- * @param Node $nodeType
35- * @phpstan-return array<Rule<TNodeType>>
36- * @return Rule[]
33+ * @param class-string<TNodeType> $nodeType
34+ * @return array<Rule<TNodeType>>
3735 */
3836public function getRules (string $ nodeType ): array
3937{
@@ -51,8 +49,7 @@ public function getRules(string $nodeType): array
5149}
5250
5351/**
54- * @phpstan-var array<Rule<TNodeType>> $selectedRules
55- * @var Rule[] $selectedRules
52+ * @var array<Rule<TNodeType>> $selectedRules
5653 */
5754$ selectedRules = $ this ->cache [$ nodeType ];
5855
Original file line number Diff line number Diff line change @@ -24,10 +24,8 @@ public function __construct(private Container $container)
2424
2525/**
2626 * @template TNodeType of Node
27- * @phpstan-param class-string<TNodeType> $nodeType
28- * @param Node $nodeType
29- * @phpstan-return array<Rule<TNodeType>>
30- * @return Rule[]
27+ * @param class-string<TNodeType> $nodeType
28+ * @return array<Rule<TNodeType>>
3129 */
3230public function getRules (string $ nodeType ): array
3331{
@@ -46,8 +44,7 @@ public function getRules(string $nodeType): array
4644}
4745
4846/**
49- * @phpstan-var array<Rule<TNodeType>> $selectedRules
50- * @var Rule[] $selectedRules
47+ * @var array<Rule<TNodeType>> $selectedRules
5148 */
5249$ selectedRules = $ this ->cache [$ nodeType ];
5350
Original file line number Diff line number Diff line change @@ -9,10 +9,8 @@ interface Registry
99
1010/**
1111 * @template TNodeType of Node
12- * @phpstan-param class-string<TNodeType> $nodeType
13- * @param Node $nodeType
14- * @phpstan-return array<Rule<TNodeType>>
15- * @return Rule[]
12+ * @param class-string<TNodeType> $nodeType
13+ * @return array<Rule<TNodeType>>
1614 */
1715public function getRules (string $ nodeType ): array ;
1816
Original file line number Diff line number Diff line change @@ -7,18 +7,18 @@ use PHPStan\Analyser\Scope;
77
88/**
99 * @api
10- * @phpstan- template TNodeType of Node
10+ * @template TNodeType of Node
1111 */
1212interface Rule
1313{
1414
1515/**
16- * @phpstan- return class-string<TNodeType>
16+ * @return class-string<TNodeType>
1717 */
1818public function getNodeType(): string;
1919
2020/**
21- * @phpstan- param TNodeType $node
21+ * @param TNodeType $node
2222 * @return list<IdentifierRuleError>
2323 */
2424public function processNode(Node $node, Scope $scope): array;
You can’t perform that action at this time.
0 commit comments