class DeprecationHelperScope
Hierarchy
- class \mglaman\PHPStanDrupal\DeprecatedScope\DeprecationHelperScope implements \PHPStan\Rules\Deprecations\DeprecatedScopeResolver
Expanded class hierarchy of DeprecationHelperScope
File
-
vendor/
mglaman/ phpstan-drupal/ src/ DeprecatedScope/ DeprecationHelperScope.php, line 14
Namespace
mglaman\PHPStanDrupal\DeprecatedScopeView source
final class DeprecationHelperScope implements DeprecatedScopeResolver {
public function isScopeDeprecated(Scope $scope) : bool {
if (!class_exists(DeprecationHelper::class)) {
return false;
}
$callStack = $scope->getFunctionCallStackWithParameters();
if (count($callStack) === 0) {
return false;
}
[
$function,
$parameter,
] = $callStack[0];
if (!$function instanceof MethodReflection) {
return false;
}
if ($function->getName() !== 'backwardsCompatibleCall' || $function->getDeclaringClass()
->getName() !== DeprecationHelper::class) {
return false;
}
return $parameter !== null && $parameter->getName() === 'deprecatedCallable';
}
}
Members
Title Sort descending | Modifiers | Object type | Summary | Overriden Title |
---|---|---|---|---|
DeprecationHelperScope::isScopeDeprecated | public | function | Overrides DeprecatedScopeResolver::isScopeDeprecated |