comparison vendor/symfony/class-loader/ApcClassLoader.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
67 * @throws \RuntimeException 67 * @throws \RuntimeException
68 * @throws \InvalidArgumentException 68 * @throws \InvalidArgumentException
69 */ 69 */
70 public function __construct($prefix, $decorated) 70 public function __construct($prefix, $decorated)
71 { 71 {
72 if (!function_exists('apcu_fetch')) { 72 if (!\function_exists('apcu_fetch')) {
73 throw new \RuntimeException('Unable to use ApcClassLoader as APC is not installed.'); 73 throw new \RuntimeException('Unable to use ApcClassLoader as APC is not installed.');
74 } 74 }
75 75
76 if (!method_exists($decorated, 'findFile')) { 76 if (!method_exists($decorated, 'findFile')) {
77 throw new \InvalidArgumentException('The class finder must implement a "findFile" method.'); 77 throw new \InvalidArgumentException('The class finder must implement a "findFile" method.');
86 * 86 *
87 * @param bool $prepend Whether to prepend the autoloader or not 87 * @param bool $prepend Whether to prepend the autoloader or not
88 */ 88 */
89 public function register($prepend = false) 89 public function register($prepend = false)
90 { 90 {
91 spl_autoload_register(array($this, 'loadClass'), true, $prepend); 91 spl_autoload_register([$this, 'loadClass'], true, $prepend);
92 } 92 }
93 93
94 /** 94 /**
95 * Unregisters this instance as an autoloader. 95 * Unregisters this instance as an autoloader.
96 */ 96 */
97 public function unregister() 97 public function unregister()
98 { 98 {
99 spl_autoload_unregister(array($this, 'loadClass')); 99 spl_autoload_unregister([$this, 'loadClass']);
100 } 100 }
101 101
102 /** 102 /**
103 * Loads the given class or interface. 103 * Loads the given class or interface.
104 * 104 *
136 /** 136 /**
137 * Passes through all unknown calls onto the decorated object. 137 * Passes through all unknown calls onto the decorated object.
138 */ 138 */
139 public function __call($method, $args) 139 public function __call($method, $args)
140 { 140 {
141 return call_user_func_array(array($this->decorated, $method), $args); 141 return \call_user_func_array([$this->decorated, $method], $args);
142 } 142 }
143 } 143 }