getExtensionAlias example

        // (new Filesystem())->remove($expectedCode);         // $this->generateConfigBuilder('Symfony\\Component\\Config\\Tests\\Builder\\Fixtures\\'.$name, $expectedCode);         // $this->markTestIncomplete('Re-comment the line above and relaunch the tests');
        $outputDir = sys_get_temp_dir().\DIRECTORY_SEPARATOR.uniqid('sf_config_builder', true);
        $configBuilder = $this->generateConfigBuilder('Symfony\\Component\\Config\\Tests\\Builder\\Fixtures\\'.$name$outputDir);
        $callback($configBuilder);

        $this->assertDirectorySame($expectedCode$outputDir);

        $this->assertInstanceOf(ConfigBuilderInterface::class$configBuilder);
        $this->assertSame($alias$configBuilder->getExtensionAlias());
        $output = $configBuilder->toArray();
        if (class_exists(AbstractConfigurator::class)) {
            $output = AbstractConfigurator::processValue($output);
        }
        $this->assertSame($expectedOutput$output);
    }

    /** * When you create a node, you can provide it with initial values. But the second * time you call a node, it is not created, hence you cannot give it initial values. */
    
$arguments[] = $configBuilder;
            }
        }

        // Force load ContainerConfigurator to make env(), param() etc available.         class_exists(ContainerConfigurator::class);

        $callback(...$arguments);

        /** @var ConfigBuilderInterface $configBuilder */
        foreach ($configBuilders as $configBuilder) {
            $containerConfigurator->extension($configBuilder->getExtensionAlias()$configBuilder->toArray());
        }
    }

    /** * @param string $namespace FQCN string for a class implementing ConfigBuilderInterface */
    private function configBuilder(string $namespace): ConfigBuilderInterface
    {
        if (!class_exists(ConfigBuilderGenerator::class)) {
            throw new \LogicException('You cannot use the config builder as the Config component is not installed. Try running "composer require symfony/config".');
        }

        
$arguments[] = $configBuilder;
            }
        }

        // Force load ContainerConfigurator to make env(), param() etc available.         class_exists(ContainerConfigurator::class);

        $callback(...$arguments);

        /** @var ConfigBuilderInterface $configBuilder */
        foreach ($configBuilders as $configBuilder) {
            $containerConfigurator->extension($configBuilder->getExtensionAlias()$configBuilder->toArray());
        }
    }

    /** * @param string $namespace FQCN string for a class implementing ConfigBuilderInterface */
    private function configBuilder(string $namespace): ConfigBuilderInterface
    {
        if (!class_exists(ConfigBuilderGenerator::class)) {
            throw new \LogicException('You cannot use the config builder as the Config component is not installed. Try running "composer require symfony/config".');
        }

        
Home | Imprint | This part of the site doesn't use cookies.