/**
* getPathType() should always be called prior to calling this method.
*
* @param string $path
*
* @return string
*/
private function getPackage($path) { $path =
realpath($path) ?:
$path;
foreach (self::
getVendors() as $vendorRoot) { if (0 ===
strpos($path,
$vendorRoot)) { $relativePath =
substr($path, \
strlen($vendorRoot) + 1
);
$vendor =
strstr($relativePath, \DIRECTORY_SEPARATOR, true
);
if (false ===
$vendor) { return 'symfony';
} return rtrim($vendor.'/'.
strstr(substr($relativePath, \
strlen($vendor) + 1
), \DIRECTORY_SEPARATOR, true
), '/'
);
} }