@@ -104,7 +104,8 @@ discard block |
||
104 | 104 | { |
105 | 105 | if (\class_exists($driver) && \str_starts_with($driver, 'Phpfastcache')) { |
106 | 106 | $driverClass = $driver; |
107 | - } else { |
|
107 | + } |
|
108 | + else { |
|
108 | 109 | $driver = self::normalizeDriverName($driver); |
109 | 110 | $driverClass = self::getDriverClass($driver); |
110 | 111 | } |
@@ -121,11 +122,13 @@ discard block |
||
121 | 122 | $instanceId, |
122 | 123 | EventManager::getInstance() |
123 | 124 | ); |
124 | - } else { |
|
125 | + } |
|
126 | + else { |
|
125 | 127 | try { |
126 | 128 | self::$driverExtensions[$driver] = ExtensionManager::getExtension($driver); |
127 | 129 | return CacheManager::getInstance($driver, $config, $instanceId); |
128 | - } catch (PhpfastcacheExtensionNotFoundException) { |
|
130 | + } |
|
131 | + catch (PhpfastcacheExtensionNotFoundException) { |
|
129 | 132 | if (in_array($driver, ExtensionManager::KNOWN_EXTENSION_NAMES, true)) { |
130 | 133 | throw new PhpfastcacheExtensionNotInstalledException(sprintf( |
131 | 134 | 'You requested a driver which is now an extension. Run the following command to solve this issue: %s', |
@@ -197,11 +200,14 @@ discard block |
||
197 | 200 | { |
198 | 201 | if (!empty(self::$driverExtensions[$driverName])) { |
199 | 202 | $driverClass = self::$driverExtensions[$driverName]; |
200 | - } elseif (!empty(self::$driverCustoms[$driverName])) { |
|
203 | + } |
|
204 | + elseif (!empty(self::$driverCustoms[$driverName])) { |
|
201 | 205 | $driverClass = self::$driverCustoms[$driverName]; |
202 | - } elseif (!empty(self::$driverOverrides[$driverName])) { |
|
206 | + } |
|
207 | + elseif (!empty(self::$driverOverrides[$driverName])) { |
|
203 | 208 | $driverClass = self::$driverOverrides[$driverName]; |
204 | - } else { |
|
209 | + } |
|
210 | + else { |
|
205 | 211 | $driverClass = self::getNamespacePath() . $driverName . '\Driver'; |
206 | 212 | } |
207 | 213 |
@@ -24,8 +24,7 @@ |
||
24 | 24 | { |
25 | 25 | protected CacheItemPoolInterface $cacheInstance; |
26 | 26 | |
27 | - public function __construct(CacheItemPoolInterface $cacheInstance) |
|
28 | - { |
|
27 | + public function __construct(CacheItemPoolInterface $cacheInstance) { |
|
29 | 28 | $this->cacheInstance = $cacheInstance; |
30 | 29 | } |
31 | 30 |
@@ -54,13 +54,13 @@ discard block |
||
54 | 54 | * @throws PhpfastcacheInvalidConfigurationException |
55 | 55 | * @throws PhpfastcacheInvalidTypeException |
56 | 56 | */ |
57 | - public function __construct(array $parameters = []) |
|
58 | - { |
|
57 | + public function __construct(array $parameters = []) { |
|
59 | 58 | foreach ($parameters as $configKey => $configVal) { |
60 | 59 | try { |
61 | 60 | if (\property_exists($this, $configKey)) { |
62 | 61 | $this->{'set' . \ucfirst($configKey)}($configVal); |
63 | - } else { |
|
62 | + } |
|
63 | + else { |
|
64 | 64 | throw new PhpfastcacheInvalidConfigurationException( |
65 | 65 | sprintf( |
66 | 66 | 'Unknown configuration option name "%s" for the config class "%s". Allowed configurations options are "%s"', |
@@ -70,7 +70,8 @@ discard block |
||
70 | 70 | ) |
71 | 71 | ); |
72 | 72 | } |
73 | - } catch (\TypeError $e) { |
|
73 | + } |
|
74 | + catch (\TypeError $e) { |
|
74 | 75 | throw new PhpfastcacheInvalidTypeException( |
75 | 76 | \sprintf( |
76 | 77 | 'TypeError exception thrown while trying to set your configuration: %s', |
@@ -342,9 +343,11 @@ discard block |
||
342 | 343 | |
343 | 344 | if ($superGlobalAccessor === null) { |
344 | 345 | $this->superGlobalAccessor = $this->getDefaultSuperGlobalAccessor(); |
345 | - } elseif (!\is_callable($superGlobalAccessor)) { |
|
346 | + } |
|
347 | + elseif (!\is_callable($superGlobalAccessor)) { |
|
346 | 348 | throw new PhpfastcacheInvalidArgumentException('The "superGlobalAccessor" callback must be callable using "__invoke" or \Closure implementation'); |
347 | - } else { |
|
349 | + } |
|
350 | + else { |
|
348 | 351 | $this->superGlobalAccessor = $superGlobalAccessor; |
349 | 352 | } |
350 | 353 |
@@ -21,8 +21,7 @@ |
||
21 | 21 | */ |
22 | 22 | class Config extends ConfigurationOption |
23 | 23 | { |
24 | - public function __construct(array $parameters = []) |
|
25 | - { |
|
24 | + public function __construct(array $parameters = []) { |
|
26 | 25 | \trigger_error( |
27 | 26 | \sprintf( |
28 | 27 | '%s class is deprecated and will be removed in v10, use %s instead.', |
@@ -49,14 +49,14 @@ discard block |
||
49 | 49 | * @throws PhpfastcacheDriverException |
50 | 50 | * @throws PhpfastcacheDriverNotFoundException |
51 | 51 | */ |
52 | - public function __construct(string|ExtendedCacheItemPoolInterface $driver, ConfigurationOptionInterface $config = null) |
|
53 | - { |
|
52 | + public function __construct(string|ExtendedCacheItemPoolInterface $driver, ConfigurationOptionInterface $config = null) { |
|
54 | 53 | if ($driver instanceof ExtendedCacheItemPoolInterface) { |
55 | 54 | if ($config !== null) { |
56 | 55 | throw new PhpfastcacheLogicException("You can't pass a config parameter along with an non-string '\$driver' parameter."); |
57 | 56 | } |
58 | 57 | $this->internalCacheInstance = $driver; |
59 | - } else { |
|
58 | + } |
|
59 | + else { |
|
60 | 60 | $this->internalCacheInstance = CacheManager::getInstance($driver, $config); |
61 | 61 | } |
62 | 62 | } |
@@ -76,7 +76,8 @@ discard block |
||
76 | 76 | } |
77 | 77 | |
78 | 78 | return $default; |
79 | - } catch (PhpfastcacheInvalidArgumentException $e) { |
|
79 | + } |
|
80 | + catch (PhpfastcacheInvalidArgumentException $e) { |
|
80 | 81 | throw new PhpfastcacheSimpleCacheException($e->getMessage(), 0, $e); |
81 | 82 | } |
82 | 83 | } |
@@ -96,11 +97,13 @@ discard block |
||
96 | 97 | ->set($value); |
97 | 98 | if (\is_int($ttl) && $ttl <= 0) { |
98 | 99 | $cacheItem->expiresAt((new DateTime('@0'))); |
99 | - } elseif ($ttl !== null) { |
|
100 | + } |
|
101 | + elseif ($ttl !== null) { |
|
100 | 102 | $cacheItem->expiresAfter($ttl); |
101 | 103 | } |
102 | 104 | return $this->internalCacheInstance->save($cacheItem); |
103 | - } catch (PhpfastcacheInvalidArgumentException $e) { |
|
105 | + } |
|
106 | + catch (PhpfastcacheInvalidArgumentException $e) { |
|
104 | 107 | throw new PhpfastcacheSimpleCacheException($e->getMessage(), 0, $e); |
105 | 108 | } |
106 | 109 | } |
@@ -115,7 +118,8 @@ discard block |
||
115 | 118 | { |
116 | 119 | try { |
117 | 120 | return $this->internalCacheInstance->deleteItem($key); |
118 | - } catch (PhpfastcacheInvalidArgumentException $e) { |
|
121 | + } |
|
122 | + catch (PhpfastcacheInvalidArgumentException $e) { |
|
119 | 123 | throw new PhpfastcacheSimpleCacheException($e->getMessage(), 0, $e); |
120 | 124 | } |
121 | 125 | } |
@@ -128,7 +132,8 @@ discard block |
||
128 | 132 | { |
129 | 133 | try { |
130 | 134 | return $this->internalCacheInstance->clear(); |
131 | - } catch (PhpfastcacheRootException $e) { |
|
135 | + } |
|
136 | + catch (PhpfastcacheRootException $e) { |
|
132 | 137 | throw new PhpfastcacheSimpleCacheException($e->getMessage(), 0, $e); |
133 | 138 | } |
134 | 139 | } |
@@ -149,7 +154,8 @@ discard block |
||
149 | 154 | static fn (ExtendedCacheItemInterface $item) => $item->isHit() ? $item->get() : $default, |
150 | 155 | $this->internalCacheInstance->getItems($keys) |
151 | 156 | ); |
152 | - } catch (PhpfastcacheInvalidArgumentException $e) { |
|
157 | + } |
|
158 | + catch (PhpfastcacheInvalidArgumentException $e) { |
|
153 | 159 | throw new PhpfastcacheSimpleCacheException($e->getMessage(), 0, $e); |
154 | 160 | } |
155 | 161 | } |
@@ -168,14 +174,16 @@ discard block |
||
168 | 174 | |
169 | 175 | if (\is_int($ttl) && $ttl <= 0) { |
170 | 176 | $cacheItem->expiresAt((new DateTime('@0'))); |
171 | - } elseif ($ttl !== null) { |
|
177 | + } |
|
178 | + elseif ($ttl !== null) { |
|
172 | 179 | $cacheItem->expiresAfter($ttl); |
173 | 180 | } |
174 | 181 | $this->internalCacheInstance->saveDeferred($cacheItem); |
175 | 182 | unset($cacheItem); |
176 | 183 | } |
177 | 184 | return $this->internalCacheInstance->commit(); |
178 | - } catch (PhpfastcacheInvalidArgumentException $e) { |
|
185 | + } |
|
186 | + catch (PhpfastcacheInvalidArgumentException $e) { |
|
179 | 187 | throw new PhpfastcacheSimpleCacheException($e->getMessage(), 0, $e); |
180 | 188 | } |
181 | 189 | } |
@@ -194,7 +202,8 @@ discard block |
||
194 | 202 | } |
195 | 203 | |
196 | 204 | return $this->internalCacheInstance->deleteItems(\iterator_to_array($keys)); |
197 | - } catch (PhpfastcacheInvalidArgumentException $e) { |
|
205 | + } |
|
206 | + catch (PhpfastcacheInvalidArgumentException $e) { |
|
198 | 207 | throw new PhpfastcacheSimpleCacheException($e->getMessage(), 0, $e); |
199 | 208 | } |
200 | 209 | } |
@@ -209,7 +218,8 @@ discard block |
||
209 | 218 | try { |
210 | 219 | $cacheItem = $this->internalCacheInstance->getItem($key); |
211 | 220 | return $cacheItem->isHit() && !$cacheItem->isExpired(); |
212 | - } catch (PhpfastcacheInvalidArgumentException $e) { |
|
221 | + } |
|
222 | + catch (PhpfastcacheInvalidArgumentException $e) { |
|
213 | 223 | throw new PhpfastcacheSimpleCacheException($e->getMessage(), 0, $e); |
214 | 224 | } |
215 | 225 | } |
@@ -28,8 +28,7 @@ |
||
28 | 28 | * CacheConditionalHelper constructor. |
29 | 29 | * @param CacheItemPoolInterface $cacheInstance |
30 | 30 | */ |
31 | - public function __construct(CacheItemPoolInterface $cacheInstance) |
|
32 | - { |
|
31 | + public function __construct(CacheItemPoolInterface $cacheInstance) { |
|
33 | 32 | \trigger_error( |
34 | 33 | \sprintf( |
35 | 34 | 'Class "%s" is deprecated, use "%s" class instead. See the documentation about this change here: %s', |
@@ -35,8 +35,7 @@ |
||
35 | 35 | |
36 | 36 | trait UninstanciableObjectTrait |
37 | 37 | { |
38 | - final protected function __construct() |
|
39 | - { |
|
38 | + final protected function __construct() { |
|
40 | 39 | // The target class is not meant to be instantiated |
41 | 40 | } |
42 | 41 | } |
@@ -34,8 +34,7 @@ |
||
34 | 34 | 'Composer\\InstalledVersions' => __DIR__ . '/..' . '/composer/InstalledVersions.php', |
35 | 35 | ); |
36 | 36 | |
37 | - public static function getInitializer(ClassLoader $loader) |
|
38 | - { |
|
37 | + public static function getInitializer(ClassLoader $loader) { |
|
39 | 38 | return \Closure::bind(function () use ($loader) { |
40 | 39 | $loader->prefixLengthsPsr4 = ComposerStaticInit6c951d886d53bc9c3b700a1be3508206::$prefixLengthsPsr4; |
41 | 40 | $loader->prefixDirsPsr4 = ComposerStaticInit6c951d886d53bc9c3b700a1be3508206::$prefixDirsPsr4; |
@@ -103,16 +103,14 @@ discard block |
||
103 | 103 | /** |
104 | 104 | * @param ?string $vendorDir |
105 | 105 | */ |
106 | - public function __construct($vendorDir = null) |
|
107 | - { |
|
106 | + public function __construct($vendorDir = null) { |
|
108 | 107 | $this->vendorDir = $vendorDir; |
109 | 108 | } |
110 | 109 | |
111 | 110 | /** |
112 | 111 | * @return string[] |
113 | 112 | */ |
114 | - public function getPrefixes() |
|
115 | - { |
|
113 | + public function getPrefixes() { |
|
116 | 114 | if (!empty($this->prefixesPsr0)) { |
117 | 115 | return call_user_func_array('array_merge', array_values($this->prefixesPsr0)); |
118 | 116 | } |
@@ -124,8 +122,7 @@ discard block |
||
124 | 122 | * @return array[] |
125 | 123 | * @psalm-return array<string, array<int, string>> |
126 | 124 | */ |
127 | - public function getPrefixesPsr4() |
|
128 | - { |
|
125 | + public function getPrefixesPsr4() { |
|
129 | 126 | return $this->prefixDirsPsr4; |
130 | 127 | } |
131 | 128 | |
@@ -133,8 +130,7 @@ discard block |
||
133 | 130 | * @return array[] |
134 | 131 | * @psalm-return array<string, string> |
135 | 132 | */ |
136 | - public function getFallbackDirs() |
|
137 | - { |
|
133 | + public function getFallbackDirs() { |
|
138 | 134 | return $this->fallbackDirsPsr0; |
139 | 135 | } |
140 | 136 | |
@@ -142,8 +138,7 @@ discard block |
||
142 | 138 | * @return array[] |
143 | 139 | * @psalm-return array<string, string> |
144 | 140 | */ |
145 | - public function getFallbackDirsPsr4() |
|
146 | - { |
|
141 | + public function getFallbackDirsPsr4() { |
|
147 | 142 | return $this->fallbackDirsPsr4; |
148 | 143 | } |
149 | 144 | |
@@ -151,8 +146,7 @@ discard block |
||
151 | 146 | * @return string[] Array of classname => path |
152 | 147 | * @psalm-return array<string, string> |
153 | 148 | */ |
154 | - public function getClassMap() |
|
155 | - { |
|
149 | + public function getClassMap() { |
|
156 | 150 | return $this->classMap; |
157 | 151 | } |
158 | 152 | |
@@ -162,11 +156,11 @@ discard block |
||
162 | 156 | * |
163 | 157 | * @return void |
164 | 158 | */ |
165 | - public function addClassMap(array $classMap) |
|
166 | - { |
|
159 | + public function addClassMap(array $classMap) { |
|
167 | 160 | if ($this->classMap) { |
168 | 161 | $this->classMap = array_merge($this->classMap, $classMap); |
169 | - } else { |
|
162 | + } |
|
163 | + else { |
|
170 | 164 | $this->classMap = $classMap; |
171 | 165 | } |
172 | 166 | } |
@@ -181,15 +175,15 @@ discard block |
||
181 | 175 | * |
182 | 176 | * @return void |
183 | 177 | */ |
184 | - public function add($prefix, $paths, $prepend = false) |
|
185 | - { |
|
178 | + public function add($prefix, $paths, $prepend = false) { |
|
186 | 179 | if (!$prefix) { |
187 | 180 | if ($prepend) { |
188 | 181 | $this->fallbackDirsPsr0 = array_merge( |
189 | 182 | (array) $paths, |
190 | 183 | $this->fallbackDirsPsr0 |
191 | 184 | ); |
192 | - } else { |
|
185 | + } |
|
186 | + else { |
|
193 | 187 | $this->fallbackDirsPsr0 = array_merge( |
194 | 188 | $this->fallbackDirsPsr0, |
195 | 189 | (array) $paths |
@@ -210,7 +204,8 @@ discard block |
||
210 | 204 | (array) $paths, |
211 | 205 | $this->prefixesPsr0[$first][$prefix] |
212 | 206 | ); |
213 | - } else { |
|
207 | + } |
|
208 | + else { |
|
214 | 209 | $this->prefixesPsr0[$first][$prefix] = array_merge( |
215 | 210 | $this->prefixesPsr0[$first][$prefix], |
216 | 211 | (array) $paths |
@@ -230,8 +225,7 @@ discard block |
||
230 | 225 | * |
231 | 226 | * @return void |
232 | 227 | */ |
233 | - public function addPsr4($prefix, $paths, $prepend = false) |
|
234 | - { |
|
228 | + public function addPsr4($prefix, $paths, $prepend = false) { |
|
235 | 229 | if (!$prefix) { |
236 | 230 | // Register directories for the root namespace. |
237 | 231 | if ($prepend) { |
@@ -239,13 +233,15 @@ discard block |
||
239 | 233 | (array) $paths, |
240 | 234 | $this->fallbackDirsPsr4 |
241 | 235 | ); |
242 | - } else { |
|
236 | + } |
|
237 | + else { |
|
243 | 238 | $this->fallbackDirsPsr4 = array_merge( |
244 | 239 | $this->fallbackDirsPsr4, |
245 | 240 | (array) $paths |
246 | 241 | ); |
247 | 242 | } |
248 | - } elseif (!isset($this->prefixDirsPsr4[$prefix])) { |
|
243 | + } |
|
244 | + elseif (!isset($this->prefixDirsPsr4[$prefix])) { |
|
249 | 245 | // Register directories for a new namespace. |
250 | 246 | $length = strlen($prefix); |
251 | 247 | if ('\\' !== $prefix[$length - 1]) { |
@@ -253,13 +249,15 @@ discard block |
||
253 | 249 | } |
254 | 250 | $this->prefixLengthsPsr4[$prefix[0]][$prefix] = $length; |
255 | 251 | $this->prefixDirsPsr4[$prefix] = (array) $paths; |
256 | - } elseif ($prepend) { |
|
252 | + } |
|
253 | + elseif ($prepend) { |
|
257 | 254 | // Prepend directories for an already registered namespace. |
258 | 255 | $this->prefixDirsPsr4[$prefix] = array_merge( |
259 | 256 | (array) $paths, |
260 | 257 | $this->prefixDirsPsr4[$prefix] |
261 | 258 | ); |
262 | - } else { |
|
259 | + } |
|
260 | + else { |
|
263 | 261 | // Append directories for an already registered namespace. |
264 | 262 | $this->prefixDirsPsr4[$prefix] = array_merge( |
265 | 263 | $this->prefixDirsPsr4[$prefix], |
@@ -277,11 +275,11 @@ discard block |
||
277 | 275 | * |
278 | 276 | * @return void |
279 | 277 | */ |
280 | - public function set($prefix, $paths) |
|
281 | - { |
|
278 | + public function set($prefix, $paths) { |
|
282 | 279 | if (!$prefix) { |
283 | 280 | $this->fallbackDirsPsr0 = (array) $paths; |
284 | - } else { |
|
281 | + } |
|
282 | + else { |
|
285 | 283 | $this->prefixesPsr0[$prefix[0]][$prefix] = (array) $paths; |
286 | 284 | } |
287 | 285 | } |
@@ -297,11 +295,11 @@ discard block |
||
297 | 295 | * |
298 | 296 | * @return void |
299 | 297 | */ |
300 | - public function setPsr4($prefix, $paths) |
|
301 | - { |
|
298 | + public function setPsr4($prefix, $paths) { |
|
302 | 299 | if (!$prefix) { |
303 | 300 | $this->fallbackDirsPsr4 = (array) $paths; |
304 | - } else { |
|
301 | + } |
|
302 | + else { |
|
305 | 303 | $length = strlen($prefix); |
306 | 304 | if ('\\' !== $prefix[$length - 1]) { |
307 | 305 | throw new \InvalidArgumentException("A non-empty PSR-4 prefix must end with a namespace separator."); |
@@ -318,8 +316,7 @@ discard block |
||
318 | 316 | * |
319 | 317 | * @return void |
320 | 318 | */ |
321 | - public function setUseIncludePath($useIncludePath) |
|
322 | - { |
|
319 | + public function setUseIncludePath($useIncludePath) { |
|
323 | 320 | $this->useIncludePath = $useIncludePath; |
324 | 321 | } |
325 | 322 | |
@@ -329,8 +326,7 @@ discard block |
||
329 | 326 | * |
330 | 327 | * @return bool |
331 | 328 | */ |
332 | - public function getUseIncludePath() |
|
333 | - { |
|
329 | + public function getUseIncludePath() { |
|
334 | 330 | return $this->useIncludePath; |
335 | 331 | } |
336 | 332 | |
@@ -342,8 +338,7 @@ discard block |
||
342 | 338 | * |
343 | 339 | * @return void |
344 | 340 | */ |
345 | - public function setClassMapAuthoritative($classMapAuthoritative) |
|
346 | - { |
|
341 | + public function setClassMapAuthoritative($classMapAuthoritative) { |
|
347 | 342 | $this->classMapAuthoritative = $classMapAuthoritative; |
348 | 343 | } |
349 | 344 | |
@@ -352,8 +347,7 @@ discard block |
||
352 | 347 | * |
353 | 348 | * @return bool |
354 | 349 | */ |
355 | - public function isClassMapAuthoritative() |
|
356 | - { |
|
350 | + public function isClassMapAuthoritative() { |
|
357 | 351 | return $this->classMapAuthoritative; |
358 | 352 | } |
359 | 353 | |
@@ -364,8 +358,7 @@ discard block |
||
364 | 358 | * |
365 | 359 | * @return void |
366 | 360 | */ |
367 | - public function setApcuPrefix($apcuPrefix) |
|
368 | - { |
|
361 | + public function setApcuPrefix($apcuPrefix) { |
|
369 | 362 | $this->apcuPrefix = function_exists('apcu_fetch') && filter_var(ini_get('apc.enabled'), FILTER_VALIDATE_BOOLEAN) ? $apcuPrefix : null; |
370 | 363 | } |
371 | 364 | |
@@ -374,8 +367,7 @@ discard block |
||
374 | 367 | * |
375 | 368 | * @return string|null |
376 | 369 | */ |
377 | - public function getApcuPrefix() |
|
378 | - { |
|
370 | + public function getApcuPrefix() { |
|
379 | 371 | return $this->apcuPrefix; |
380 | 372 | } |
381 | 373 | |
@@ -386,8 +378,7 @@ discard block |
||
386 | 378 | * |
387 | 379 | * @return void |
388 | 380 | */ |
389 | - public function register($prepend = false) |
|
390 | - { |
|
381 | + public function register($prepend = false) { |
|
391 | 382 | spl_autoload_register(array($this, 'loadClass'), true, $prepend); |
392 | 383 | |
393 | 384 | if (null === $this->vendorDir) { |
@@ -396,7 +387,8 @@ discard block |
||
396 | 387 | |
397 | 388 | if ($prepend) { |
398 | 389 | self::$registeredLoaders = array($this->vendorDir => $this) + self::$registeredLoaders; |
399 | - } else { |
|
390 | + } |
|
391 | + else { |
|
400 | 392 | unset(self::$registeredLoaders[$this->vendorDir]); |
401 | 393 | self::$registeredLoaders[$this->vendorDir] = $this; |
402 | 394 | } |
@@ -407,8 +399,7 @@ discard block |
||
407 | 399 | * |
408 | 400 | * @return void |
409 | 401 | */ |
410 | - public function unregister() |
|
411 | - { |
|
402 | + public function unregister() { |
|
412 | 403 | spl_autoload_unregister(array($this, 'loadClass')); |
413 | 404 | |
414 | 405 | if (null !== $this->vendorDir) { |
@@ -422,8 +413,7 @@ discard block |
||
422 | 413 | * @param string $class The name of the class |
423 | 414 | * @return true|null True if loaded, null otherwise |
424 | 415 | */ |
425 | - public function loadClass($class) |
|
426 | - { |
|
416 | + public function loadClass($class) { |
|
427 | 417 | if ($file = $this->findFile($class)) { |
428 | 418 | includeFile($file); |
429 | 419 | |
@@ -440,8 +430,7 @@ discard block |
||
440 | 430 | * |
441 | 431 | * @return string|false The path if found, false otherwise |
442 | 432 | */ |
443 | - public function findFile($class) |
|
444 | - { |
|
433 | + public function findFile($class) { |
|
445 | 434 | // class map lookup |
446 | 435 | if (isset($this->classMap[$class])) { |
447 | 436 | return $this->classMap[$class]; |
@@ -480,8 +469,7 @@ discard block |
||
480 | 469 | * |
481 | 470 | * @return self[] |
482 | 471 | */ |
483 | - public static function getRegisteredLoaders() |
|
484 | - { |
|
472 | + public static function getRegisteredLoaders() { |
|
485 | 473 | return self::$registeredLoaders; |
486 | 474 | } |
487 | 475 | |
@@ -490,8 +478,7 @@ discard block |
||
490 | 478 | * @param string $ext |
491 | 479 | * @return string|false |
492 | 480 | */ |
493 | - private function findFileWithExtension($class, $ext) |
|
494 | - { |
|
481 | + private function findFileWithExtension($class, $ext) { |
|
495 | 482 | // PSR-4 lookup |
496 | 483 | $logicalPathPsr4 = strtr($class, '\\', DIRECTORY_SEPARATOR) . $ext; |
497 | 484 | |
@@ -524,7 +511,8 @@ discard block |
||
524 | 511 | // namespaced class name |
525 | 512 | $logicalPathPsr0 = substr($logicalPathPsr4, 0, $pos + 1) |
526 | 513 | . strtr(substr($logicalPathPsr4, $pos + 1), '_', DIRECTORY_SEPARATOR); |
527 | - } else { |
|
514 | + } |
|
515 | + else { |
|
528 | 516 | // PEAR-like class name |
529 | 517 | $logicalPathPsr0 = strtr($class, '_', DIRECTORY_SEPARATOR) . $ext; |
530 | 518 | } |
@@ -566,7 +554,6 @@ discard block |
||
566 | 554 | * @return void |
567 | 555 | * @private |
568 | 556 | */ |
569 | -function includeFile($file) |
|
570 | -{ |
|
557 | +function includeFile($file) { |
|
571 | 558 | include $file; |
572 | 559 | } |