Mercurial > hg > isophonics-drupal-site
comparison vendor/symfony/class-loader/WinCacheClassLoader.php @ 17:129ea1e6d783
Update, including to Drupal core 8.6.10
author | Chris Cannam |
---|---|
date | Thu, 28 Feb 2019 13:21:36 +0000 |
parents | 1fec387a4317 |
children |
comparison
equal
deleted
inserted
replaced
16:c2387f117808 | 17:129ea1e6d783 |
---|---|
66 * @throws \RuntimeException | 66 * @throws \RuntimeException |
67 * @throws \InvalidArgumentException | 67 * @throws \InvalidArgumentException |
68 */ | 68 */ |
69 public function __construct($prefix, $decorated) | 69 public function __construct($prefix, $decorated) |
70 { | 70 { |
71 if (!extension_loaded('wincache')) { | 71 if (!\extension_loaded('wincache')) { |
72 throw new \RuntimeException('Unable to use WinCacheClassLoader as WinCache is not enabled.'); | 72 throw new \RuntimeException('Unable to use WinCacheClassLoader as WinCache is not enabled.'); |
73 } | 73 } |
74 | 74 |
75 if (!method_exists($decorated, 'findFile')) { | 75 if (!method_exists($decorated, 'findFile')) { |
76 throw new \InvalidArgumentException('The class finder must implement a "findFile" method.'); | 76 throw new \InvalidArgumentException('The class finder must implement a "findFile" method.'); |
85 * | 85 * |
86 * @param bool $prepend Whether to prepend the autoloader or not | 86 * @param bool $prepend Whether to prepend the autoloader or not |
87 */ | 87 */ |
88 public function register($prepend = false) | 88 public function register($prepend = false) |
89 { | 89 { |
90 spl_autoload_register(array($this, 'loadClass'), true, $prepend); | 90 spl_autoload_register([$this, 'loadClass'], true, $prepend); |
91 } | 91 } |
92 | 92 |
93 /** | 93 /** |
94 * Unregisters this instance as an autoloader. | 94 * Unregisters this instance as an autoloader. |
95 */ | 95 */ |
96 public function unregister() | 96 public function unregister() |
97 { | 97 { |
98 spl_autoload_unregister(array($this, 'loadClass')); | 98 spl_autoload_unregister([$this, 'loadClass']); |
99 } | 99 } |
100 | 100 |
101 /** | 101 /** |
102 * Loads the given class or interface. | 102 * Loads the given class or interface. |
103 * | 103 * |
135 /** | 135 /** |
136 * Passes through all unknown calls onto the decorated object. | 136 * Passes through all unknown calls onto the decorated object. |
137 */ | 137 */ |
138 public function __call($method, $args) | 138 public function __call($method, $args) |
139 { | 139 { |
140 return call_user_func_array(array($this->decorated, $method), $args); | 140 return \call_user_func_array([$this->decorated, $method], $args); |
141 } | 141 } |
142 } | 142 } |