Commaaa2
This commit is contained in:
@@ -20,12 +20,9 @@ class PhpFileLoader extends FileLoader
|
||||
{
|
||||
private static ?array $cache = [];
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
protected function loadResource(string $resource): array
|
||||
{
|
||||
if ([] === self::$cache && \function_exists('opcache_invalidate') && filter_var(\ini_get('opcache.enable'), \FILTER_VALIDATE_BOOLEAN) && (!\in_array(\PHP_SAPI, ['cli', 'phpdbg'], true) || filter_var(\ini_get('opcache.enable_cli'), \FILTER_VALIDATE_BOOLEAN))) {
|
||||
if ([] === self::$cache && \function_exists('opcache_invalidate') && filter_var(\ini_get('opcache.enable'), \FILTER_VALIDATE_BOOL) && (!\in_array(\PHP_SAPI, ['cli', 'phpdbg', 'embed'], true) || filter_var(\ini_get('opcache.enable_cli'), \FILTER_VALIDATE_BOOL))) {
|
||||
self::$cache = null;
|
||||
}
|
||||
|
||||
@@ -33,10 +30,6 @@ class PhpFileLoader extends FileLoader
|
||||
return require $resource;
|
||||
}
|
||||
|
||||
if (isset(self::$cache[$resource])) {
|
||||
return self::$cache[$resource];
|
||||
}
|
||||
|
||||
return self::$cache[$resource] = require $resource;
|
||||
return self::$cache[$resource] ??= require $resource;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user