Skip to content

Commit df11a5e

Browse files
committed
Specify generics in rules and rule tests
1 parent f71eca9 commit df11a5e

29 files changed

+87
-71
lines changed

phpcs.xml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,10 @@
2323
@dataProvider,
2424
@requires
2525
"/>
26+
<property name="enableObjectTypeHint" value="false"/>
2627
</properties>
28+
<exclude name="SlevomatCodingStandard.TypeHints.TypeHintDeclaration.MissingTraversableParameterTypeHintSpecification"/>
29+
<exclude name="SlevomatCodingStandard.TypeHints.TypeHintDeclaration.MissingTraversableReturnTypeHintSpecification"/>
2730
</rule>
2831
<rule ref="SlevomatCodingStandard.ControlStructures.AssignmentInCondition"/>
2932
<rule ref="SlevomatCodingStandard.ControlStructures.DisallowEqualOperators"/>

src/Rules/Deprecations/AccessDeprecatedPropertyRule.php

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,9 @@
99
use PHPStan\Broker\Broker;
1010
use PHPStan\Type\TypeUtils;
1111

12+
/**
13+
* @implements \PHPStan\Rules\Rule<PropertyFetch>
14+
*/
1215
class AccessDeprecatedPropertyRule implements \PHPStan\Rules\Rule
1316
{
1417

@@ -25,11 +28,6 @@ public function getNodeType(): string
2528
return PropertyFetch::class;
2629
}
2730

28-
/**
29-
* @param PropertyFetch $node
30-
* @param \PHPStan\Analyser\Scope $scope
31-
* @return string[] errors
32-
*/
3331
public function processNode(Node $node, Scope $scope): array
3432
{
3533
if (DeprecatedScopeHelper::isScopeDeprecated($scope)) {

src/Rules/Deprecations/AccessDeprecatedStaticPropertyRule.php

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,9 @@
1212
use PHPStan\Type\ErrorType;
1313
use PHPStan\Type\Type;
1414

15+
/**
16+
* @implements \PHPStan\Rules\Rule<StaticPropertyFetch>
17+
*/
1518
class AccessDeprecatedStaticPropertyRule implements \PHPStan\Rules\Rule
1619
{
1720

@@ -32,11 +35,6 @@ public function getNodeType(): string
3235
return StaticPropertyFetch::class;
3336
}
3437

35-
/**
36-
* @param StaticPropertyFetch $node
37-
* @param \PHPStan\Analyser\Scope $scope
38-
* @return string[] errors
39-
*/
4038
public function processNode(Node $node, Scope $scope): array
4139
{
4240
if (DeprecatedScopeHelper::isScopeDeprecated($scope)) {

src/Rules/Deprecations/CallToDeprecatedFunctionRule.php

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@
77
use PHPStan\Analyser\Scope;
88
use PHPStan\Broker\Broker;
99

10+
/**
11+
* @implements \PHPStan\Rules\Rule<FuncCall>
12+
*/
1013
class CallToDeprecatedFunctionRule implements \PHPStan\Rules\Rule
1114
{
1215

@@ -23,11 +26,6 @@ public function getNodeType(): string
2326
return FuncCall::class;
2427
}
2528

26-
/**
27-
* @param FuncCall $node
28-
* @param \PHPStan\Analyser\Scope $scope
29-
* @return string[] errors
30-
*/
3129
public function processNode(Node $node, Scope $scope): array
3230
{
3331
if (DeprecatedScopeHelper::isScopeDeprecated($scope)) {

src/Rules/Deprecations/CallToDeprecatedMethodRule.php

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,9 @@
99
use PHPStan\Broker\Broker;
1010
use PHPStan\Type\TypeUtils;
1111

12+
/**
13+
* @implements \PHPStan\Rules\Rule<MethodCall>
14+
*/
1215
class CallToDeprecatedMethodRule implements \PHPStan\Rules\Rule
1316
{
1417

@@ -25,11 +28,6 @@ public function getNodeType(): string
2528
return MethodCall::class;
2629
}
2730

28-
/**
29-
* @param MethodCall $node
30-
* @param \PHPStan\Analyser\Scope $scope
31-
* @return string[] errors
32-
*/
3331
public function processNode(Node $node, Scope $scope): array
3432
{
3533
if (DeprecatedScopeHelper::isScopeDeprecated($scope)) {

src/Rules/Deprecations/CallToDeprecatedStaticMethodRule.php

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,9 @@
1212
use PHPStan\Type\ErrorType;
1313
use PHPStan\Type\Type;
1414

15+
/**
16+
* @implements \PHPStan\Rules\Rule<StaticCall>
17+
*/
1518
class CallToDeprecatedStaticMethodRule implements \PHPStan\Rules\Rule
1619
{
1720

@@ -32,11 +35,6 @@ public function getNodeType(): string
3235
return StaticCall::class;
3336
}
3437

35-
/**
36-
* @param StaticCall $node
37-
* @param \PHPStan\Analyser\Scope $scope
38-
* @return string[] errors
39-
*/
4038
public function processNode(Node $node, Scope $scope): array
4139
{
4240
if (DeprecatedScopeHelper::isScopeDeprecated($scope)) {

src/Rules/Deprecations/FetchingClassConstOfDeprecatedClassRule.php

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,9 @@
1212
use PHPStan\Type\ErrorType;
1313
use PHPStan\Type\Type;
1414

15+
/**
16+
* @implements \PHPStan\Rules\Rule<ClassConstFetch>
17+
*/
1518
class FetchingClassConstOfDeprecatedClassRule implements \PHPStan\Rules\Rule
1619
{
1720

@@ -32,11 +35,6 @@ public function getNodeType(): string
3235
return ClassConstFetch::class;
3336
}
3437

35-
/**
36-
* @param ClassConstFetch $node
37-
* @param \PHPStan\Analyser\Scope $scope
38-
* @return string[] errors
39-
*/
4038
public function processNode(Node $node, Scope $scope): array
4139
{
4240
if (DeprecatedScopeHelper::isScopeDeprecated($scope)) {

src/Rules/Deprecations/ImplementationOfDeprecatedInterfaceRule.php

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@
77
use PHPStan\Analyser\Scope;
88
use PHPStan\Broker\Broker;
99

10+
/**
11+
* @implements \PHPStan\Rules\Rule<Class_>
12+
*/
1013
class ImplementationOfDeprecatedInterfaceRule implements \PHPStan\Rules\Rule
1114
{
1215

@@ -23,11 +26,6 @@ public function getNodeType(): string
2326
return Class_::class;
2427
}
2528

26-
/**
27-
* @param Class_ $node
28-
* @param \PHPStan\Analyser\Scope $scope
29-
* @return string[] errors
30-
*/
3129
public function processNode(Node $node, Scope $scope): array
3230
{
3331
if (DeprecatedScopeHelper::isScopeDeprecated($scope)) {

src/Rules/Deprecations/InheritanceOfDeprecatedClassRule.php

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@
77
use PHPStan\Analyser\Scope;
88
use PHPStan\Broker\Broker;
99

10+
/**
11+
* @implements \PHPStan\Rules\Rule<Class_>
12+
*/
1013
class InheritanceOfDeprecatedClassRule implements \PHPStan\Rules\Rule
1114
{
1215

@@ -23,11 +26,6 @@ public function getNodeType(): string
2326
return Class_::class;
2427
}
2528

26-
/**
27-
* @param Class_ $node
28-
* @param \PHPStan\Analyser\Scope $scope
29-
* @return string[] errors
30-
*/
3129
public function processNode(Node $node, Scope $scope): array
3230
{
3331
if (DeprecatedScopeHelper::isScopeDeprecated($scope)) {

src/Rules/Deprecations/InheritanceOfDeprecatedInterfaceRule.php

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@
77
use PHPStan\Analyser\Scope;
88
use PHPStan\Broker\Broker;
99

10+
/**
11+
* @implements \PHPStan\Rules\Rule<Interface_>
12+
*/
1013
class InheritanceOfDeprecatedInterfaceRule implements \PHPStan\Rules\Rule
1114
{
1215

@@ -23,11 +26,6 @@ public function getNodeType(): string
2326
return Interface_::class;
2427
}
2528

26-
/**
27-
* @param Interface_ $node
28-
* @param \PHPStan\Analyser\Scope $scope
29-
* @return string[] errors
30-
*/
3129
public function processNode(Node $node, Scope $scope): array
3230
{
3331
if ($node->extends === null) {

0 commit comments

Comments
 (0)