Skip to content

Commit

Permalink
Update IncompatiblePhpDocTypeRule.php
Browse files Browse the repository at this point in the history
  • Loading branch information
staabm committed Dec 16, 2023
1 parent 509207d commit 57617ed
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/Rules/PhpDoc/IncompatiblePhpDocTypeRule.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,11 +42,6 @@ public function getNodeType(): string

public function processNode(Node $node, Scope $scope): array
{
$docComment = $node->getDocComment();
if ($docComment === null) {
return [];
}

if ($node instanceof Node\Stmt\ClassMethod) {
$functionName = $node->name->name;
} elseif ($node instanceof Node\Stmt\Function_) {
Expand All @@ -55,6 +50,11 @@ public function processNode(Node $node, Scope $scope): array
return [];
}

$docComment = $node->getDocComment();
if ($docComment === null) {
return [];
}

$resolvedPhpDoc = $this->fileTypeMapper->getResolvedPhpDoc(
$scope->getFile(),
$scope->isInClass() ? $scope->getClassReflection()->getName() : null,
Expand Down

0 comments on commit 57617ed

Please sign in to comment.