Skip to content

Commit 6ff7064

Browse files
committed
some fixes
1 parent ee41009 commit 6ff7064

3 files changed

Lines changed: 14 additions & 4 deletions

src/Rule/CommandClassShouldBeHelpCommandHandlerClass.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,9 @@
1313
use PHPStan\PhpDocParser\Parser\TokenIterator;
1414
use PHPStan\Rules\Rule;
1515

16+
/**
17+
* @implements Rule<Class_>
18+
*/
1619
final class CommandClassShouldBeHelpCommandHandlerClass implements Rule
1720
{
1821

src/Rule/EventListenerClassShouldBeIncludeAsListenerAttribute.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,9 @@
1010
use PHPStan\Reflection\ReflectionProvider;
1111
use PHPStan\Rules\Rule;
1212

13+
/**
14+
* @implements Rule<Class_>
15+
*/
1316
final class EventListenerClassShouldBeIncludeAsListenerAttribute implements Rule
1417
{
1518

src/Rule/NotShouldPhpdocReturnIfExistTypeHint.php

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
namespace Simtel\PHPStanRules\Rule;
66

77
use PhpParser\Node;
8+
use PhpParser\Node\Stmt\Class_;
89
use PHPStan\Analyser\Scope;
910
use PHPStan\PhpDocParser\Ast\PhpDoc\ReturnTagValueNode;
1011
use PHPStan\PhpDocParser\Lexer\Lexer;
@@ -13,6 +14,9 @@
1314
use PHPStan\Reflection\ReflectionProvider;
1415
use PHPStan\Rules\Rule;
1516

17+
/**
18+
* @implements Rule<Class_>
19+
*/
1620
final class NotShouldPhpdocReturnIfExistTypeHint implements Rule
1721
{
1822

@@ -25,7 +29,7 @@ public function __construct(
2529

2630
public function getNodeType(): string
2731
{
28-
return Node\Stmt\Class_::class;
32+
return Class_::class;
2933
}
3034

3135
public function processNode(Node $node, Scope $scope): array
@@ -53,9 +57,9 @@ public function processNode(Node $node, Scope $scope): array
5357
}
5458
if ($tag->value instanceof ReturnTagValueNode) {
5559
$value = $tag->value->type->name;
56-
}
57-
if ($value === $returnType) {
58-
return ['PhpDoc attribute @return can be remove'];
60+
if ($value === $returnType) {
61+
return ['PhpDoc attribute @return can be remove'];
62+
}
5963
}
6064
}
6165
}

0 commit comments

Comments
 (0)