comparison vendor/symfony/class-loader/XcacheClassLoader.php @ 4:a9cd425dd02b

Update, including to Drupal core 8.6.10
author Chris Cannam
date Thu, 28 Feb 2019 13:11:55 +0000
parents c75dbcec494b
children
comparison
equal deleted inserted replaced
3:307d7a7fd348 4:a9cd425dd02b
60 * @throws \RuntimeException 60 * @throws \RuntimeException
61 * @throws \InvalidArgumentException 61 * @throws \InvalidArgumentException
62 */ 62 */
63 public function __construct($prefix, $decorated) 63 public function __construct($prefix, $decorated)
64 { 64 {
65 if (!extension_loaded('xcache')) { 65 if (!\extension_loaded('xcache')) {
66 throw new \RuntimeException('Unable to use XcacheClassLoader as XCache is not enabled.'); 66 throw new \RuntimeException('Unable to use XcacheClassLoader as XCache is not enabled.');
67 } 67 }
68 68
69 if (!method_exists($decorated, 'findFile')) { 69 if (!method_exists($decorated, 'findFile')) {
70 throw new \InvalidArgumentException('The class finder must implement a "findFile" method.'); 70 throw new \InvalidArgumentException('The class finder must implement a "findFile" method.');
79 * 79 *
80 * @param bool $prepend Whether to prepend the autoloader or not 80 * @param bool $prepend Whether to prepend the autoloader or not
81 */ 81 */
82 public function register($prepend = false) 82 public function register($prepend = false)
83 { 83 {
84 spl_autoload_register(array($this, 'loadClass'), true, $prepend); 84 spl_autoload_register([$this, 'loadClass'], true, $prepend);
85 } 85 }
86 86
87 /** 87 /**
88 * Unregisters this instance as an autoloader. 88 * Unregisters this instance as an autoloader.
89 */ 89 */
90 public function unregister() 90 public function unregister()
91 { 91 {
92 spl_autoload_unregister(array($this, 'loadClass')); 92 spl_autoload_unregister([$this, 'loadClass']);
93 } 93 }
94 94
95 /** 95 /**
96 * Loads the given class or interface. 96 * Loads the given class or interface.
97 * 97 *
130 /** 130 /**
131 * Passes through all unknown calls onto the decorated object. 131 * Passes through all unknown calls onto the decorated object.
132 */ 132 */
133 public function __call($method, $args) 133 public function __call($method, $args)
134 { 134 {
135 return call_user_func_array(array($this->decorated, $method), $args); 135 return \call_user_func_array([$this->decorated, $method], $args);
136 } 136 }
137 } 137 }