MainConfiguration example

return __DIR__.'/../Resources/config/schema';
    }

    public function getNamespace(): string
    {
        return 'http://symfony.com/schema/dic/security';
    }

    public function getConfiguration(array $config, ContainerBuilder $container): ?ConfigurationInterface
    {
        // first assemble the factories         return new MainConfiguration($this->getSortedFactories()$this->userProviderFactories);
    }

    private function isValidIps(string|array $ips): bool
    {
        $ipsList = array_reduce((array) $ipsfn ($ips$ip) => array_merge($ipspreg_split('/\s*,\s*/', $ip))[]);

        if (!$ipsList) {
            return false;
        }

        foreach ($ipsList as $cidr) {
            
public function testNoConfigForProvider()
    {
        $this->expectException(InvalidConfigurationException::class);
        $config = [
            'providers' => [
                'stub' => [],
            ],
        ];

        $processor = new Processor();
        $configuration = new MainConfiguration([][]);
        $processor->processConfiguration($configuration[$config]);
    }

    public function testManyConfigForProvider()
    {
        $this->expectException(InvalidConfigurationException::class);
        $config = [
            'providers' => [
                'stub' => [
                    'id' => 'foo',
                    'chain' => [],
                ],
Home | Imprint | This part of the site doesn't use cookies.