function NameContext::normalizeConstName
1 call to NameContext::normalizeConstName()
- NameContext::getPossibleNames in vendor/
nikic/ php-parser/ lib/ PhpParser/ NameContext.php - Get possible ways of writing a fully qualified name (e.g., by making use of aliases).
File
-
vendor/
nikic/ php-parser/ lib/ PhpParser/ NameContext.php, line 273
Class
Namespace
PhpParserCode
private function normalizeConstName(string $name) : string {
$nsSep = strrpos($name, '\\');
if (false === $nsSep) {
return $name;
}
// Constants have case-insensitive namespace and case-sensitive short-name
$ns = substr($name, 0, $nsSep);
$shortName = substr($name, $nsSep + 1);
return strtolower($ns) . '\\' . $shortName;
}