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
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
..
Symfony/Tests/Component [DependencyInjection] added first version of the config normalizer 2011-02-01 16:07:04 +01:00
bootstrap.php simplified bootstrap.php 2010-06-30 10:29:27 +02:00