<commit_before><?php

namespace Innmind\Rest\Server;

use Innmind\Rest\Server\Definition\Types;
use Symfony\Component\Config\Definition\ConfigurationInterface;
use Symfony\Component\Config\Definition\Builder\TreeBuilder;

class Configuration implements ConfigurationInterface
{
    /**
     * {@inheritdoc}
     */
    public function getConfigTreeBuilder()
    {
        $builder = new TreeBuilder;
        $root = $builder->root('innmind_rest_server');

        $root
            ->children()
                ->append($this->getCollectionNode())
            ->end();

        return $builder;
    }

    /**
     * Return the node to specify the resources collections
     *
     * @return NodeInterface
     */
    public function getCollectionNode()
    {
        $builder = new TreeBuilder;
        $root = $builder->root('collections');

        $root
            ->requiresAtLeastOneElement()
            ->useAttributeAsKey('name')
            ->prototype('array')
                ->children()
                    ->scalarNode('storage')->end()
                    ->arrayNode('resources')
                        ->useAttributeAsKey('name')
                        ->requiresAtLeastOneElement()
                        ->prototype('array')
                            ->children()
                                ->scalarNode('id')
                                    ->isRequired()
                                ->end()
                                ->scalarNode('storage')->end()
                                ->arrayNode('properties')
                                    ->useAttributeAsKey('name')<commit_msg>default to null value if no storage specified<commit_after><?php

namespace Innmind\Rest\Server;

use Innmind\Rest\Server\Definition\Types;
use Symfony\Component\Config\Definition\ConfigurationInterface;
use Symfony\Component\Config\Definition\Builder\TreeBuilder;

class Configuration implements ConfigurationInterface
{
    /**
     * {@inheritdoc}
     */
    public function getConfigTreeBuilder()
    {
        $builder = new TreeBuilder;
        $root = $builder->root('innmind_rest_server');

        $root
            ->children()
                ->append($this->getCollectionNode())
            ->end();

        return $builder;
    }

    /**
     * Return the node to specify the resources collections
     *
     * @return NodeInterface
     */
    public function getCollectionNode()
    {
        $builder = new TreeBuilder;
        $root = $builder->root('collections');

        $root
            ->requiresAtLeastOneElement()
            ->useAttributeAsKey('name')
            ->prototype('array')
                ->children()
                    ->scalarNode('storage')
                        ->defaultValue(null)
                    ->end()
                    ->arrayNode('resources')
                        ->useAttributeAsKey('name')
                        ->requiresAtLeastOneElement()
                        ->prototype('array')
                            ->children()
                                ->scalarNode('id')
                                    ->isRequired()
                                ->end()
                                ->scalarNode('storage')
                                    ->defaultValue(null)
                                ->end()
                                ->arrayNode('properties')
                                    ->useAttributeAsKey('name')
{'fraction_non_alphanumeric': 0.11265969802555169, 'fraction_numerical': 0.0, 'mean_word_length': 1.337177747625509, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 53, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 5, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1307135', 'n_tokens_mistral': 788, 'n_tokens_neox': 751, 'n_words': 136}