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

Breadcrumb

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

class IgnoreDeprecationsScope

Hierarchy

  • class \mglaman\PHPStanDrupal\DeprecatedScope\IgnoreDeprecationsScope implements \PHPStan\Rules\Deprecations\DeprecatedScopeResolver

Expanded class hierarchy of IgnoreDeprecationsScope

File

vendor/mglaman/phpstan-drupal/src/DeprecatedScope/IgnoreDeprecationsScope.php, line 11

Namespace

mglaman\PHPStanDrupal\DeprecatedScope
View source
final class IgnoreDeprecationsScope implements DeprecatedScopeResolver {
    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;
    }

}

Members

Title Sort descending Modifiers Object type Summary Overriden Title
IgnoreDeprecationsScope::isScopeDeprecated public function Overrides DeprecatedScopeResolver::isScopeDeprecated
RSS feed
Powered by Drupal