Skip to content

Commit 6d9a964

Browse files
PHP 7.4 compatibility
1 parent 2c76493 commit 6d9a964

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/Rules/InternalTag/RestrictedInternalUsageHelper.php

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,12 @@ public function shouldBeReported(Scope $scope, string $name): bool
1414
{
1515
$currentNamespace = $scope->getNamespace();
1616
if ($currentNamespace === null) {
17-
$currentClass = $scope->getClassReflection()?->getName();
17+
$classReflection = $scope->getClassReflection();
18+
if (null === $classReflection) {
19+
return true;
20+
}
1821

19-
return $currentClass !== $name;
22+
return $classReflection->getName() !== $name;
2023
}
2124

2225
$currentNamespace = explode('\\', $currentNamespace)[0];

0 commit comments

Comments
 (0)