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

Breadcrumb

  1. Drupal Core 11.1.x

DefaultDeprecatedScopeResolver.php

Namespace

PHPStan\Rules\Deprecations

File

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

View source
<?php

declare (strict_types=1);
namespace PHPStan\Rules\Deprecations;

use PHPStan\Analyser\Scope;
final class DefaultDeprecatedScopeResolver implements DeprecatedScopeResolver {
    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;
    }

}

Classes

Title Deprecated Summary
DefaultDeprecatedScopeResolver

API Navigation

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