This repository has been archived on 2023-08-20. You can view files and clone it, but cannot push or open issues or pull requests.
symfony/tests/Symfony/Tests/Component/DependencyInjection
Johannes Schmitt b484763a7a [DependencyInjection] added first version of the config normalizer
This is mainly intended for complex configurations to ease the work you
have with normalizing different configuration formats (YAML, XML, and PHP).

First, you have to set-up a config tree:

    $treeBuilder = new TreeBuilder();
    $tree = $treeBuilder
        ->root('security_config', 'array')
            ->node('access_denied_url', 'scalar')->end()
            ->normalize('encoder')
            ->node('encoders', 'array')
                ->key('class')
                ->prototype('array')
                    ->before()->ifString()->then(function($v) { return array('algorithm' => $v); })->end()
                    ->node('algorithm', 'scalar')->end()
                    ->node('encode_as_base64', 'scalar')->end()
                    ->node('iterations', 'scalar')->end()
                ->end()
            ->end()
        ->end()
        ->buildTree()
    ;

This tree and the metadata attached to the different nodes is then used
to intelligently transform the passed config array:

    $normalizedConfig = $tree->normalize($config);
2011-02-01 16:07:04 +01:00
..
Compiler add definition inheritance support 2011-01-28 09:12:29 +01:00
Configuration [DependencyInjection] added first version of the config normalizer 2011-02-01 16:07:04 +01:00
Dumper normalized license messages in PHP files 2011-01-18 08:07:46 +01:00
Extension adds helper method to normalize keys 2011-01-25 15:59:51 +01:00
Fixtures add definition inheritance support 2011-01-28 09:12:29 +01:00
Loader adds scope to the DI container 2011-01-22 15:20:50 +01:00
ParameterBag normalized license messages in PHP files 2011-01-18 08:07:46 +01:00
Resource normalized license messages in PHP files 2011-01-18 08:07:46 +01:00
ContainerBuilderTest.php adds scope to the DI container 2011-01-22 15:20:50 +01:00
ContainerTest.php adds scope to the DI container 2011-01-22 15:20:50 +01:00
CrossCheckTest.php normalized license messages in PHP files 2011-01-18 08:07:46 +01:00
DefinitionDecoratorTest.php add definition inheritance support 2011-01-28 09:12:29 +01:00
DefinitionTest.php add definition inheritance support 2011-01-28 09:12:29 +01:00
InterfaceInjectorTest.php normalized license messages in PHP files 2011-01-18 08:07:46 +01:00
ParameterTest.php normalized license messages in PHP files 2011-01-18 08:07:46 +01:00
ReferenceTest.php normalized license messages in PHP files 2011-01-18 08:07:46 +01:00