Attribute as key for Symfony configuration

Code
<?php

use Symfony\Component\Config\Definition\Processor;
use 
Symfony\Component\Config\Definition\ConfigurationInterface;
use 
Symfony\Component\Config\Definition\Builder\TreeBuilder;


class 
Configuration implements ConfigurationInterface
{
    public function 
getConfigTreeBuilder()
    {
        
$treeBuilder= new TreeBuilder();
        
$rootNode $treeBuilder->root('my_config');
        
        
$rootNode->children()
            ->
arrayNode('types')
            ->
useAttributeAsKey('typename')
            ->
prototype('array')
            ->
children()
                ->
integerNode('number')
                    ->
min(3)
                    ->
max(9)
                ->
end()
                ->
booleanNode('boolean')
                    ->
defaultTrue()
                ->
end()
                ->
scalarNode('string')
                ->
end()
            ->
end();
        
        return 
$treeBuilder;
    }
}

$configuration = new Configuration();
$processor = new Processor();

// config is valid and processed
$config = ['my_config' => [
'types' => [
    
'foo' => [
        
'number' => 5,
        
'string' => 'value',
    ],
    
'bar' => [
        
'number' => 8,
        
'string' => 'othervalue',
        
'boolean' => false,
    ]]
]];

$config $processor
    
->processConfiguration($configuration$config);

foreach(
$config['types'] as $typename => $subconfig) {
    echo 
$typename ':' PHP_EOL;
    
var_dump($subconfig);
    echo 
PHP_EOL;
}

Result
foo:
array(3) {
["number"]=>
int(5)
["string"]=>
string(5) "value"
["boolean"]=>
bool(true)
}

bar:
array(3) {
["number"]=>
int(8)
["string"]=>
string(10) "othervalue"
["boolean"]=>
bool(false)
}
Used Versions
PHP 7.1, Zend 3.0, Symfony 3.2, Laravel 5.2, PHPUnit 5.6, Doctrine 2.6