Repository: symfony/symfony
File: src/Symfony/Bundle/SecurityBundle/DependencyInjection/SecurityExtension.php (PHP)

Code before:
            return 'security.user_providers';
        }

        throw new InvalidConfigurationException(\sprintf('Not configuring explicitly the provider for the "%s" authenticator on "%s" firewall is ambiguous as there is more than one registered provider. Set the "provider" key to one of the configured providers, even if your custom authenticators don\'t use it.', $factoryKey, $id));
    }

    private function createMissingUserProvider(ContainerBuilder $container, string $id, string $factoryKey): string
    {
        $userProvider = \sprintf('security.user.provider.missing.%s', $factoryKey);
        $container->setDefinition(
            $userProvider,
            (new ChildDefinition('security.user.provider.missing'))->replaceArgument(0, $id)
        );

        return $userProvider;
    }

    private function createHashers(array $hashers, ContainerBuilder $container): void
    {
        $hasherMap = [];
        foreach ($hashers as $class => $hasher) {
            $hasherMap[$class] = $this->createHasher($hasher);
            // The key is not a class, so we register an alias for argument to
            // ease getting the hasher
            if (!class_exists($class) && !interface_exists($class)) {
                $id = 'security.password_hasher.' .ContainerBuilder::hash($class);
                $container
                    ->register($id, PasswordHasherInterface::class)
                    ->setFactory([new Reference('security.password_hasher_factory'), 'getPasswordHasher'])
                    ->setArgument(0, $class)
                ;
                $container->registerAliasForArgument($id, PasswordHasherInterface::class, $class);
            }
        }

        $container
            ->getDefinition('security.password_hasher_factory')
            ->setArguments([$hasherMap])
        ;
    }

    /**
     * @param array<string, mixed> $config
     *
     * @return Reference|array<string, mixed>
     */
    private function createHasher(array $config): Reference|array
    {
        // a custom hasher service
        if (isset($config['id'])) {
            return $config['migrate_from'] ?? false ? [

Review comment (security):
maybe just 
```suggestion
                $id = 'security.password_hasher.' .$class;
```

Code after:
            return 'security.user_providers';
        }

        throw new InvalidConfigurationException(\sprintf('Not configuring explicitly the provider for the "%s" authenticator on "%s" firewall is ambiguous as there is more than one registered provider. Set the "provider" key to one of the configured providers, even if your custom authenticators don\'t use it.', $factoryKey, $id));
    }

    private function createMissingUserProvider(ContainerBuilder $container, string $id, string $factoryKey): string
    {
        $userProvider = \sprintf('security.user.provider.missing.%s', $factoryKey);
        $container->setDefinition(
            $userProvider,
            (new ChildDefinition('security.user.provider.missing'))->replaceArgument(0, $id)
        );

        return $userProvider;
    }

    private function createHashers(array $hashers, ContainerBuilder $container): void
    {
        $hasherMap = [];
        foreach ($hashers as $class => $hasher) {
            $hasherMap[$class] = $this->createHasher($hasher);
            // The key is not a class, so we register an alias for argument to
            // ease getting the hasher
            if (!class_exists($class) && !interface_exists($class)) {
                $id = 'security.password_hasher.'.$class;
                $container
                    ->register($id, PasswordHasherInterface::class)
                    ->setFactory([new Reference('security.password_hasher_factory'), 'getPasswordHasher'])
                    ->setArgument(0, $class)
                ;
                $container->registerAliasForArgument($id, PasswordHasherInterface::class, $class);
            }
        }

        $container
            ->getDefinition('security.password_hasher_factory')
            ->setArguments([$hasherMap])
        ;
    }

    /**
     * @param array<string, mixed> $config
     *
     * @return Reference|array<string, mixed>
     */
    private function createHasher(array $config): Reference|array
    {
        // a custom hasher service
        if (isset($config['id'])) {
            return $config['migrate_from'] ?? false ? [