Skip to content

Commit 8f90880

Browse files
committed
[Icons] Fix aliases and default_attributes config types for config/reference.php
1 parent 4800dec commit 8f90880

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/Icons/src/DependencyInjection/UXIconsExtension.php

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
namespace Symfony\UX\Icons\DependencyInjection;
1313

1414
use Symfony\Component\AssetMapper\Event\PreAssetsCompileEvent;
15+
use Symfony\Component\Config\Definition\Builder\ArrayNodeDefinition;
1516
use Symfony\Component\Config\Definition\Builder\TreeBuilder;
1617
use Symfony\Component\Config\Definition\ConfigurationInterface;
1718
use Symfony\Component\Config\FileLocator;
@@ -63,7 +64,9 @@ public function getConfigTreeBuilder(): TreeBuilder
6364
->info('Override default icon attributes for icons in this set.')
6465
->example(['class' => 'icon icon-acme', 'fill' => 'none'])
6566
->normalizeKeys(false)
66-
->variablePrototype()
67+
->useAttributeAsKey('key')
68+
->{method_exists(ArrayNodeDefinition::class, 'stringPrototype') ? 'stringPrototype' : 'scalarPrototype'}()
69+
->cannotBeEmpty()
6770
->end()
6871
->end()
6972
->end()
@@ -80,7 +83,8 @@ public function getConfigTreeBuilder(): TreeBuilder
8083
'privacy' => 'bi:cookie',
8184
])
8285
->normalizeKeys(false)
83-
->scalarPrototype()
86+
->useAttributeAsKey('key')
87+
->{method_exists(ArrayNodeDefinition::class, 'stringPrototype') ? 'stringPrototype' : 'scalarPrototype'}()
8488
->cannotBeEmpty()
8589
->end()
8690
->end()

0 commit comments

Comments
 (0)