Neos\Flow\Core\ClassLoader::isAutoloadTypeWithPredictableClassPath PHP Method

isAutoloadTypeWithPredictableClassPath() public static method

Is the given mapping type predictable in terms of path to class name
public static isAutoloadTypeWithPredictableClassPath ( string $mappingType ) : boolean
$mappingType string
return boolean
    public static function isAutoloadTypeWithPredictableClassPath($mappingType)
    {
        return $mappingType === static::MAPPING_TYPE_PSR0 || $mappingType === static::MAPPING_TYPE_PSR4;
    }

Usage Example

 /**
  * @param PackageInterface $package
  * @return array
  */
 protected function getPrimaryNamespaceAndEntryPath(PackageInterface $package)
 {
     $autoloadConfigurations = $package->getComposerManifest('autoload');
     $firstAutoloadType = null;
     $firstAutoloadConfiguration = null;
     foreach ($autoloadConfigurations as $autoloadType => $autoloadConfiguration) {
         if (ClassLoader::isAutoloadTypeWithPredictableClassPath($autoloadType)) {
             $firstAutoloadType = $autoloadType;
             $firstAutoloadConfiguration = $autoloadConfiguration;
             break;
         }
     }
     $autoloadPaths = reset($firstAutoloadConfiguration);
     $firstAutoloadPath = is_array($autoloadPaths) ? reset($autoloadPaths) : $autoloadPaths;
     $namespace = key($firstAutoloadConfiguration);
     $autoloadPathPostfix = '';
     if ($firstAutoloadType === ClassLoader::MAPPING_TYPE_PSR0) {
         $autoloadPathPostfix = str_replace('\\', '/', trim($namespace, '\\'));
     }
     return [$namespace, Files::concatenatePaths([$package->getPackagePath(), $firstAutoloadPath, $autoloadPathPostfix]), $firstAutoloadType];
 }
All Usage Examples Of Neos\Flow\Core\ClassLoader::isAutoloadTypeWithPredictableClassPath