aboutsummaryrefslogtreecommitdiffstats
path: root/lib/autoloader.php
diff options
context:
space:
mode:
Diffstat (limited to 'lib/autoloader.php')
-rw-r--r--lib/autoloader.php12
1 files changed, 5 insertions, 7 deletions
diff --git a/lib/autoloader.php b/lib/autoloader.php
index 41b272a457c..7084eb93c89 100644
--- a/lib/autoloader.php
+++ b/lib/autoloader.php
@@ -22,10 +22,8 @@ class Autoloader {
/**
* Optional low-latency memory cache for class to path mapping.
- *
- * @var \OC\Memcache\Cache
*/
- protected $memoryCache;
+ protected ?ICache $memoryCache = null;
/**
* Autoloader constructor.
@@ -127,15 +125,15 @@ class Autoloader {
* @throws AutoloadNotAllowedException
*/
public function load(string $class): bool {
+ if (class_exists($class, false)) {
+ return false;
+ }
+
$pathsToRequire = null;
if ($this->memoryCache) {
$pathsToRequire = $this->memoryCache->get($class);
}
- if (class_exists($class, false)) {
- return false;
- }
-
if (!is_array($pathsToRequire)) {
// No cache or cache miss
$pathsToRequire = [];