function BuilderHelpers::normalizeIdentifier
Normalizes strings to Identifier.
Parameters
string|Identifier $name The identifier to normalize:
Return value
Identifier The normalized identifier
3 calls to BuilderHelpers::normalizeIdentifier()
- BuilderFactory::args in vendor/
nikic/ php-parser/ lib/ PhpParser/ BuilderFactory.php - Normalizes an argument list.
- TraitUseAdaptation::as in vendor/
nikic/ php-parser/ lib/ PhpParser/ Builder/ TraitUseAdaptation.php - Sets alias of method.
- TraitUseAdaptation::__construct in vendor/
nikic/ php-parser/ lib/ PhpParser/ Builder/ TraitUseAdaptation.php - Creates a trait use adaptation builder.
File
-
vendor/
nikic/ php-parser/ lib/ PhpParser/ BuilderHelpers.php, line 68
Class
- BuilderHelpers
- This class defines helpers used in the implementation of builders. Don't use it directly.
Namespace
PhpParserCode
public static function normalizeIdentifier($name) : Identifier {
if ($name instanceof Identifier) {
return $name;
}
if (\is_string($name)) {
return new Identifier($name);
}
throw new \LogicException('Expected string or instance of Node\\Identifier');
}