From 222cd6c4cc67e436a4798127d307070036647060 Mon Sep 17 00:00:00 2001 From: Dimitri Sitchet Tomkeu Date: Tue, 28 Jan 2025 14:44:41 +0100 Subject: [PATCH] style: organisation des elements du service --- src/Container/Services.php | 40 +++++++++++++++++++------------------- 1 file changed, 20 insertions(+), 20 deletions(-) diff --git a/src/Container/Services.php b/src/Container/Services.php index b34e750d..56050fde 100644 --- a/src/Container/Services.php +++ b/src/Container/Services.php @@ -240,25 +240,6 @@ public static function encrypter(?array $config = null, bool $shared = false): E return static::$instances[Encryption::class] = $encryption; } - /** - * La classe Encryption fournit un cryptage bidirectionnel. - * - * @return Hasher - */ - public static function hashing(?array $config = null, bool $shared = true): HasherInterface - { - if (true === $shared && isset(static::$instances[Hasher::class])) { - return static::$instances[Hasher::class]; - } - - $config ??= config('hashing'); - $config = (object) $config; - $hasher = new Hasher($config); - $hasher->initialize($config); - - return static::$instances[Hasher::class] = $hasher; - } - /** * Gestionnaire d'evenement * @@ -285,6 +266,25 @@ public static function fs(bool $shared = true): Filesystem return static::$instances[Filesystem::class] = new Filesystem(); } + /** + * La classe Encryption fournit un cryptage bidirectionnel. + * + * @return Hasher + */ + public static function hashing(?array $config = null, bool $shared = true): HasherInterface + { + if (true === $shared && isset(static::$instances[Hasher::class])) { + return static::$instances[Hasher::class]; + } + + $config ??= config('hashing'); + $config = (object) $config; + $hasher = new Hasher($config); + $hasher->initialize($config); + + return static::$instances[Hasher::class] = $hasher; + } + /** * Responsable du chargement des traductions des chaƮnes de langue. * @@ -305,7 +305,7 @@ public static function locator(bool $shared = true): LocatorInterface if (! isset(static::$instances[Locator::class])) { $locator = new Locator(static::autoloader()); if (true === config('optimize.locator_cache_enabled', false)) { - static::$instances[Locator::class] = new LocatorCached($locator, new FileVarExportHandler()); + static::$instances[Locator::class] = new LocatorCached($locator, new FileVarExportHandler(FRAMEWORK_STORAGE_PATH . 'cache')); } else { static::$instances[Locator::class] = $locator; }