Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. DeprecationHelperScope.php

function DeprecationHelperScope::isScopeDeprecated

Overrides DeprecatedScopeResolver::isScopeDeprecated

File

vendor/mglaman/phpstan-drupal/src/DeprecatedScope/DeprecationHelperScope.php, line 16

Class

DeprecationHelperScope

Namespace

mglaman\PHPStanDrupal\DeprecatedScope

Code

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';
}
RSS feed
Powered by Drupal