Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 20 additions & 20 deletions src/Container/Services.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
*
Expand All @@ -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.
*
Expand All @@ -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;
}
Expand Down
Loading