Skip to content

Commit b6729db

Browse files
committed
adjust to feedback for configuration
1 parent 0b2ce04 commit b6729db

File tree

2 files changed

+4
-17
lines changed

2 files changed

+4
-17
lines changed

DependencyInjection/Configuration.php

Lines changed: 3 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -78,23 +78,9 @@ public function getConfigTreeBuilder()
7878
->addDefaultsIfNotSet()
7979
->canBeEnabled()
8080
->fixXmlConfig('route_basepath')
81-
->beforeNormalization()
82-
->ifTrue(function ($v) {
83-
return isset($v['route_basepath']);
84-
})
85-
->then(function ($v) {
86-
$base = isset($v['route_basepaths']) ? $v['route_basepaths'] : array();
87-
if (is_array($v['route_basepath'])) {
88-
// xml configuration
89-
$base += $v['route_basepath'];
90-
} else {
91-
$base[] = $v['route_basepath'];
92-
}
93-
$v['route_basepaths'] = array_unique($base);
94-
unset($v['route_basepath']);
95-
96-
return $v;
97-
})
81+
->validate()
82+
->ifTrue(function ($v) { isset($v['route_basepath']) && isset($v['route_basepaths']); })
83+
->thenInvalid('Found values for both "route_basepath" and "route_basepaths", use "route_basepaths" instead.')
9884
->end()
9985
->children()
10086
->scalarNode('manager_name')->defaultNull()->end()

Resources/config/schema/routing-1.0.xsd

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,7 @@
8181

8282
<xsd:attribute name="enabled" type="xsd:boolean" />
8383
<xsd:attribute name="manager-name" type="xsd:string" />
84+
<!-- the route-basepath is for BC only. you should use the route-basepath children elements -->
8485
<xsd:attribute name="route-basepath" type="xsd:string" />
8586
<xsd:attribute name="content-basepath" type="xsd:string" />
8687
<xsd:attribute name="use-sonata-admin" type="enable_auto" />

0 commit comments

Comments
 (0)