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

Breadcrumb

  1. Drupal Core 11.1.x

GroupLegacyScope.php

Namespace

mglaman\PHPStanDrupal\DeprecatedScope

File

vendor/mglaman/phpstan-drupal/src/DeprecatedScope/GroupLegacyScope.php

View source
<?php

declare (strict_types=1);
namespace mglaman\PHPStanDrupal\DeprecatedScope;

use PHPStan\Analyser\Scope;
use PHPStan\Rules\Deprecations\DeprecatedScopeResolver;
use function strpos;
final class GroupLegacyScope implements DeprecatedScopeResolver {
    public function isScopeDeprecated(Scope $scope) : bool {
        if ($scope->isInClass()) {
            $class = $scope->getClassReflection();
            $phpDoc = $class->getResolvedPhpDoc();
            if ($phpDoc !== null && strpos($phpDoc->getPhpDocString(), '@group legacy') !== false) {
                return true;
            }
        }
        $function = $scope->getFunction();
        return $function !== null && $function->getDocComment() !== null && strpos($function->getDocComment(), '@group legacy') !== false;
    }

}

Classes

Title Deprecated Summary
GroupLegacyScope

API Navigation

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