@@ -281,13 +281,13 @@ |
||
| 281 | 281 | public static function locator(bool $shared = true): LocatorInterface |
| 282 | 282 | { |
| 283 | 283 | if ($shared) { |
| 284 | - if (!isset(static::$instances[Locator::class])) { |
|
| 285 | - $locator = new Locator(static::autoloader()); |
|
| 286 | - if (true === config('optimize.locator_cache_enabled', false)) { |
|
| 287 | - static::$instances[Locator::class] = new LocatorCached($locator, new FileVarExportHandler()); |
|
| 288 | - } else { |
|
| 289 | - static::$instances[Locator::class] = $locator; |
|
| 290 | - } |
|
| 284 | + if (!isset(static::$instances[Locator::class])) { |
|
| 285 | + $locator = new Locator(static::autoloader()); |
|
| 286 | + if (true === config('optimize.locator_cache_enabled', false)) { |
|
| 287 | + static::$instances[Locator::class] = new LocatorCached($locator, new FileVarExportHandler()); |
|
| 288 | + } else { |
|
| 289 | + static::$instances[Locator::class] = $locator; |
|
| 290 | + } |
|
| 291 | 291 | } |
| 292 | 292 | |
| 293 | 293 | return static::$instances[Locator::class]; |
@@ -58,13 +58,13 @@ |
||
| 58 | 58 | return EXIT_SUCCESS; |
| 59 | 59 | } |
| 60 | 60 | |
| 61 | - private function clearCache(): void |
|
| 61 | + private function clearCache(): void |
|
| 62 | 62 | { |
| 63 | - $locator = new LocatorCached(new Locator(service('autoloader')), new FileVarExportHandler()); |
|
| 63 | + $locator = new LocatorCached(new Locator(service('autoloader')), new FileVarExportHandler()); |
|
| 64 | 64 | |
| 65 | 65 | $locator->deleteCache(); |
| 66 | 66 | |
| 67 | - $this->ok('Suppression de FileLocatorCache.')->eol(); |
|
| 67 | + $this->ok('Suppression de FileLocatorCache.')->eol(); |
|
| 68 | 68 | |
| 69 | 69 | $this->removeFile(FRAMEWORK_STORAGE_PATH . 'cache/FactoriesCache_config'); |
| 70 | 70 | } |