diff options
author | Mario <mario@mariovavti.com> | 2023-01-20 11:05:15 +0000 |
---|---|---|
committer | Mario <mario@mariovavti.com> | 2023-01-20 11:05:15 +0000 |
commit | 9dc949b62c6b5e3c8872211f71b11714d9d22b22 (patch) | |
tree | 38c06e7a128742e219eb74d6adb035f2f106918a /vendor/composer/ClassLoader.php | |
parent | 40394b94d7c8a8bf1f61f5482195164fff434b90 (diff) | |
download | volse-hubzilla-9dc949b62c6b5e3c8872211f71b11714d9d22b22.tar.gz volse-hubzilla-9dc949b62c6b5e3c8872211f71b11714d9d22b22.tar.bz2 volse-hubzilla-9dc949b62c6b5e3c8872211f71b11714d9d22b22.zip |
native dark theme initial checkin
Diffstat (limited to 'vendor/composer/ClassLoader.php')
-rw-r--r-- | vendor/composer/ClassLoader.php | 36 |
1 files changed, 22 insertions, 14 deletions
diff --git a/vendor/composer/ClassLoader.php b/vendor/composer/ClassLoader.php index 3a8ed4886..fd56bd7d8 100644 --- a/vendor/composer/ClassLoader.php +++ b/vendor/composer/ClassLoader.php @@ -43,7 +43,7 @@ namespace Composer\Autoload; class ClassLoader { /** @var \Closure(string):void */ - private $includeFile; + private static $includeFile; /** @var ?string */ private $vendorDir; @@ -109,18 +109,7 @@ class ClassLoader public function __construct($vendorDir = null) { $this->vendorDir = $vendorDir; - - /** - * Scope isolated include. - * - * Prevents access to $this/self from included files. - * - * @param string $file - * @return void - */ - $this->includeFile = static function($file) { - include $file; - }; + self::initializeIncludeClosure(); } /** @@ -440,7 +429,7 @@ class ClassLoader public function loadClass($class) { if ($file = $this->findFile($class)) { - ($this->includeFile)($file); + (self::$includeFile)($file); return true; } @@ -570,4 +559,23 @@ class ClassLoader return false; } + + private static function initializeIncludeClosure(): void + { + if (self::$includeFile !== null) { + return; + } + + /** + * Scope isolated include. + * + * Prevents access to $this/self from included files. + * + * @param string $file + * @return void + */ + self::$includeFile = static function($file) { + include $file; + }; + } } |