protected removeNamespaceMapEntry ( string $namespace, string $classPath, string $mappingType = self::MAPPING_TYPE_PSR0 ) : void | ||
$namespace | string | A namespace mapped to a class path. |
$classPath | string | The class path to be removed. |
$mappingType | string | The mapping type for this mapping entry. Currently one of self::MAPPING_TYPE_PSR0 or self::MAPPING_TYPE_PSR4 will work. Defaults to self::MAPPING_TYPE_PSR0 |
리턴 | void |
protected function removeNamespaceMapEntry($namespace, $classPath, $mappingType = self::MAPPING_TYPE_PSR0)
{
$unifiedClassPath = Files::getNormalizedPath($classPath);
$entryIdentifier = md5($unifiedClassPath . '-' . $mappingType);
$currentArray =& $this->packageNamespaces;
foreach (explode('\\', rtrim($namespace, '\\')) as $namespacePart) {
if (!isset($currentArray[$namespacePart])) {
return;
}
$currentArray =& $currentArray[$namespacePart];
}
if (!isset($currentArray['_pathData'])) {
return;
}
if (isset($currentArray['_pathData'][$entryIdentifier])) {
unset($currentArray['_pathData'][$entryIdentifier]);
if (empty($currentArray['_pathData'])) {
unset($currentArray['_pathData']);
}
}
}