Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Processor replaces '-' with '_' (underscore) by itself without warning #7405

@ghost

Description

I noticed kind a weird behavior of Symfony\Component\Config\Definition\Processor when processConfiguration method is run with some configuration class (that implements ConfigurationInterface. For example (part of Configuration class):

$node
->children()
->arrayNode('reportables')
->requiresAtLeastOneElement()
->prototype('scalar')->end()
->end()
->end();

when configuration looks like this:

'reportables' => array(
'my-type' => 'reportable-provider-service',
'my-other-type' => 'other-reportable-provider-service',
),

the result is (notice '-' replaced with '_'):

'reportables' => array(
'my_type' => 'reportable-provider-service',
'my_other_type' => 'other-reportable-provider-service',
),

Should this be done automatically ? Without any warning or validation error ?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions