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

Breadcrumb

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

function DefaultDeprecatedScopeResolver::isScopeDeprecated

Overrides DeprecatedScopeResolver::isScopeDeprecated

File

vendor/phpstan/phpstan-deprecation-rules/src/Rules/Deprecations/DefaultDeprecatedScopeResolver.php, line 10

Class

DefaultDeprecatedScopeResolver

Namespace

PHPStan\Rules\Deprecations

Code

public function isScopeDeprecated(Scope $scope) : bool {
    $class = $scope->getClassReflection();
    if ($class !== null && $class->isDeprecated()) {
        return true;
    }
    $trait = $scope->getTraitReflection();
    if ($trait !== null && $trait->isDeprecated()) {
        return true;
    }
    $function = $scope->getFunction();
    if ($function !== null && $function->isDeprecated()
        ->yes()) {
        return true;
    }
    return false;
}

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal