Skip to content

Commit 5711cdd

Browse files
committed
Merge remote-tracking branch 'origin/1.12.x' into 2.0.x
2 parents 3665635 + 4d3a9ab commit 5711cdd

File tree

7 files changed

+21
-34
lines changed

7 files changed

+21
-34
lines changed

Diff for: src/Collectors/Collector.php

+4-4
Original file line numberDiff line numberDiff line change
@@ -20,19 +20,19 @@
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
*/
2626
interface Collector
2727
{
2828

2929
/**
30-
* @phpstan-return class-string<TNodeType>
30+
* @return class-string<TNodeType>
3131
*/
3232
public function getNodeType(): string;
3333

3434
/**
35-
* @phpstan-param TNodeType $node
35+
* @param TNodeType $node
3636
* @return TValue|null Collected data
3737
*/
3838
public function processNode(Node $node, Scope $scope);

Diff for: src/Collectors/Registry.php

+3-6
Original file line numberDiff line numberDiff 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
*/
3533
public 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

Diff for: src/DependencyInjection/Container.php

+3-4
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,9 @@ public function hasService(string $serviceName): bool;
1414
public 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
*/
2221
public function getByType(string $className);
2322

Diff for: src/DependencyInjection/Nette/NetteContainer.php

+3-4
Original file line numberDiff line numberDiff 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
*/
4039
public function getByType(string $className)
4140
{

Diff for: src/Rules/DirectRegistry.php

+3-6
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,8 @@ public function __construct(array $rules)
2727

2828
/**
2929
* @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>>
3432
*/
3533
public function getRules(string $nodeType): array
3634
{
@@ -48,8 +46,7 @@ public function getRules(string $nodeType): array
4846
}
4947

5048
/**
51-
* @phpstan-var array<Rule<TNodeType>> $selectedRules
52-
* @var Rule[] $selectedRules
49+
* @var array<Rule<TNodeType>> $selectedRules
5350
*/
5451
$selectedRules = $this->cache[$nodeType];
5552

Diff for: src/Rules/LazyRegistry.php

+3-6
Original file line numberDiff line numberDiff 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
*/
3230
public 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

Diff for: src/Rules/Registry.php

+2-4
Original file line numberDiff line numberDiff 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
*/
1715
public function getRules(string $nodeType): array;
1816

0 commit comments

Comments
 (0)