static function AbstractCachedClassLoader::create in X Autoload 7.4
Same name and namespace in other branches
- 7.5 src/ClassLoader/AbstractCachedClassLoader.php \Drupal\xautoload\ClassLoader\AbstractCachedClassLoader::create()
This method has side effects, so it is not the constructor.
Parameters
ClassFinderInterface $finder:
CacheManager $cacheManager:
Return value
self
Throws
\Exception
File
- lib/
ClassLoader/ AbstractCachedClassLoader.php, line 28
Class
Namespace
Drupal\xautoload\ClassLoaderCode
static function create($finder, $cacheManager) {
/** @var self $loader */
$loader = new static($finder);
if (!$loader
->checkRequirements()) {
$class = get_class($loader);
throw new CacheNotSupportedException("Unable to use {$class}, because the respetive PHP extension is not enabled.");
}
$cacheManager
->observeCachePrefix($loader);
return $loader;
}