File tree 7 files changed +21
-34
lines changed
7 files changed +21
-34
lines changed Original file line number Diff line number Diff line change 20
20
* Learn more: https://phpstan.org/developing-extensions/collectors
21
21
*
22
22
* @api
23
- * @phpstan- template-covariant TNodeType of Node
24
- * @phpstan- template-covariant TValue
23
+ * @template-covariant TNodeType of Node
24
+ * @template-covariant TValue
25
25
*/
26
26
interface Collector
27
27
{
28
28
29
29
/**
30
- * @phpstan- return class-string<TNodeType>
30
+ * @return class-string<TNodeType>
31
31
*/
32
32
public function getNodeType (): string ;
33
33
34
34
/**
35
- * @phpstan- param TNodeType $node
35
+ * @param TNodeType $node
36
36
* @return TValue|null Collected data
37
37
*/
38
38
public 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)
27
27
28
28
/**
29
29
* @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>>
34
32
*/
35
33
public function getCollectors (string $ nodeType ): array
36
34
{
@@ -48,8 +46,7 @@ public function getCollectors(string $nodeType): array
48
46
}
49
47
50
48
/**
51
- * @phpstan-var array<Collector<TNodeType, mixed>> $selectedCollectors
52
- * @var Collector[] $selectedCollectors
49
+ * @var array<Collector<TNodeType, mixed>> $selectedCollectors
53
50
*/
54
51
$ selectedCollectors = $ this ->cache [$ nodeType ];
55
52
Original file line number Diff line number Diff line change @@ -14,10 +14,9 @@ public function hasService(string $serviceName): bool;
14
14
public function getService (string $ serviceName );
15
15
16
16
/**
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
21
20
*/
22
21
public function getByType (string $ className );
23
22
Original file line number Diff line number Diff line change @@ -32,10 +32,9 @@ public function getService(string $serviceName)
32
32
}
33
33
34
34
/**
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
39
38
*/
40
39
public function getByType (string $ className )
41
40
{
Original file line number Diff line number Diff line change @@ -27,10 +27,8 @@ public function __construct(array $rules)
27
27
28
28
/**
29
29
* @template TNodeType of Node
30
- * @phpstan-param class-string<TNodeType> $nodeType
31
- * @param Node $nodeType
32
- * @phpstan-return array<Rule<TNodeType>>
33
- * @return Rule[]
30
+ * @param class-string<TNodeType> $nodeType
31
+ * @return array<Rule<TNodeType>>
34
32
*/
35
33
public function getRules (string $ nodeType ): array
36
34
{
@@ -48,8 +46,7 @@ public function getRules(string $nodeType): array
48
46
}
49
47
50
48
/**
51
- * @phpstan-var array<Rule<TNodeType>> $selectedRules
52
- * @var Rule[] $selectedRules
49
+ * @var array<Rule<TNodeType>> $selectedRules
53
50
*/
54
51
$ selectedRules = $ this ->cache [$ nodeType ];
55
52
Original file line number Diff line number Diff line change @@ -24,10 +24,8 @@ public function __construct(private Container $container)
24
24
25
25
/**
26
26
* @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>>
31
29
*/
32
30
public function getRules (string $ nodeType ): array
33
31
{
@@ -46,8 +44,7 @@ public function getRules(string $nodeType): array
46
44
}
47
45
48
46
/**
49
- * @phpstan-var array<Rule<TNodeType>> $selectedRules
50
- * @var Rule[] $selectedRules
47
+ * @var array<Rule<TNodeType>> $selectedRules
51
48
*/
52
49
$ selectedRules = $ this ->cache [$ nodeType ];
53
50
Original file line number Diff line number Diff line change @@ -9,10 +9,8 @@ interface Registry
9
9
10
10
/**
11
11
* @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>>
16
14
*/
17
15
public function getRules (string $ nodeType ): array ;
18
16
You can’t perform that action at this time.
0 commit comments