function IgnoreDeprecationsScope::isScopeDeprecated
Overrides DeprecatedScopeResolver::isScopeDeprecated
File
-
vendor/
mglaman/ phpstan-drupal/ src/ DeprecatedScope/ IgnoreDeprecationsScope.php, line 14
Class
Namespace
mglaman\PHPStanDrupal\DeprecatedScopeCode
public function isScopeDeprecated(Scope $scope) : bool {
if (!class_exists(IgnoreDeprecations::class)) {
return false;
}
if ($scope->isInClass()) {
$class = $scope->getClassReflection()
->getNativeReflection();
if ($class->getAttributes(IgnoreDeprecations::class) !== []) {
return true;
}
$function = $scope->getFunction();
if ($function === null) {
return false;
}
$method = $class->getMethod($function->getName());
if ($method->getAttributes(IgnoreDeprecations::class) !== []) {
return true;
}
}
return false;
}