Skip to content

Commit 7126141

Browse files
committed
Use specialized config methods instead of the generic ifTrue() method
1 parent 9a9dbc3 commit 7126141

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

DependencyInjection/Configuration.php

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -69,10 +69,7 @@ public function getConfigTreeBuilder()
6969
->booleanNode('test')->end()
7070
->scalarNode('default_locale')->defaultValue('en')->end()
7171
->arrayNode('trusted_hosts')
72-
->beforeNormalization()
73-
->ifTrue(function ($v) { return is_string($v); })
74-
->then(function ($v) { return array($v); })
75-
->end()
72+
->beforeNormalization()->ifString()->then(function ($v) { return array($v); })->end()
7673
->prototype('scalar')->end()
7774
->end()
7875
->end()
@@ -263,7 +260,7 @@ private function addTemplatingSection(ArrayNodeDefinition $rootNode)
263260
->addDefaultChildrenIfNoneSet()
264261
->prototype('scalar')->defaultValue('FrameworkBundle:Form')->end()
265262
->validate()
266-
->ifTrue(function ($v) {return !in_array('FrameworkBundle:Form', $v); })
263+
->ifNotInArray(array('FrameworkBundle:Form'))
267264
->then(function ($v) {
268265
return array_merge(array('FrameworkBundle:Form'), $v);
269266
})

0 commit comments

Comments
 (0)