PluginProbe
WP Debugging / 2.11.4
WP Debugging v2.11.4
2.12.6 2.12.5 trunk 2.10.0 2.10.1 2.10.2 2.11.0 2.11.1 2.11.10 2.11.11 2.11.12 2.11.13 2.11.14 2.11.15 2.11.16 2.11.17 2.11.18 2.11.19 2.11.2 2.11.20 2.11.21 2.11.22 2.11.23 2.11.24 2.11.3 All 59 releases
← All changes | vendor/composer/ClassLoader.php +14 -23 2.11.15 → 2.11.4 View file →
@@ -41,11 +41,8 @@
41 41 * @see https://www.php-fig.org/psr/psr-4/
42 42 */
43 43 class ClassLoader
44 44 {
45 - /** @var \Closure(string):void */
46 - private static $includeFile;
47 -
48 45 /** @var ?string */
49 46 private $vendorDir;
50 47
51 48 // PSR-4
@@ -108,9 +105,8 @@
108 105 */
109 106 public function __construct($vendorDir = null)
110 107 {
111 108 $this->vendorDir = $vendorDir;
112 - self::initializeIncludeClosure();
113 109 }
114 110
115 111 /**
116 112 * @return string[]
@@ -428,9 +424,9 @@
428 424 */
429 425 public function loadClass($class)
430 426 {
431 427 if ($file = $this->findFile($class)) {
432 - (self::$includeFile)($file);
428 + includeFile($file);
433 429
434 430 return true;
435 431 }
436 432
@@ -558,24 +554,19 @@
558 554 }
559 555
560 556 return false;
561 557 }
558 +}
562 559
563 - private static function initializeIncludeClosure(): void
564 - {
565 - if (self::$includeFile !== null) {
566 - return;
567 - }
568 -
569 - /**
570 - * Scope isolated include.
571 - *
572 - * Prevents access to $this/self from included files.
573 - *
574 - * @param string $file
575 - * @return void
576 - */
577 - self::$includeFile = static function($file) {
578 - include $file;
579 - };
580 - }
560 +/**
561 + * Scope isolated include.
562 + *
563 + * Prevents access to $this/self from included files.
564 + *
565 + * @param string $file
566 + * @return void
567 + * @private
568 + */
569 +function includeFile($file)
570 +{
571 + include $file;
581 572 }