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\DrupalCode
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;
}