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 +15 -16 2.11.192.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 $includeFile;
47 -
48 45 /** @var ?string */
49 46 private $vendorDir;
50 47
51 48 // PSR-4
@@ -108,20 +105,8 @@
108 105 */
109 106 public function __construct($vendorDir = null)
110 107 {
111 108 $this->vendorDir = $vendorDir;
112 -
113 - /**
114 - * Scope isolated include.
115 - *
116 - * Prevents access to $this/self from included files.
117 - *
118 - * @param string $file
119 - * @return void
120 - */
121 - $this->includeFile = static function($file) {
122 - include $file;
123 - };
124 109 }
125 110
126 111 /**
127 112 * @return string[]
@@ -439,9 +424,9 @@
439 424 */
440 425 public function loadClass($class)
441 426 {
442 427 if ($file = $this->findFile($class)) {
443 - ($this->includeFile)($file);
428 + includeFile($file);
444 429
445 430 return true;
446 431 }
447 432
@@ -569,5 +554,19 @@
569 554 }
570 555
571 556 return false;
572 557 }
558 +}
559 +
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;
573 572 }