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

Breadcrumb

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

function LoadIncludeBase::getStringArgValue

1 call to LoadIncludeBase::getStringArgValue()
LoadIncludeBase::parseLoadIncludeArgs in vendor/mglaman/phpstan-drupal/src/Rules/Drupal/LoadIncludeBase.php

File

vendor/mglaman/phpstan-drupal/src/Rules/Drupal/LoadIncludeBase.php, line 28

Class

LoadIncludeBase
@template TNodeType of Node @implements Rule<TNodeType>

Namespace

mglaman\PHPStanDrupal\Rules\Drupal

Code

private function getStringArgValue(Node\Expr $expr, Scope $scope) : ?string {
    $type = $scope->getType($expr);
    $stringTypes = $type->getConstantStrings();
    if (count($stringTypes) > 0) {
        return $stringTypes[0]->getValue();
    }
    return null;
}

API Navigation

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