minor #32322 [FrameworkBundle] Simplified some code in the DI configuration (javiereguiluz)
This PR was submitted for the 3.4 branch but it was merged into the 4.4 branch instead (closes #32322).
Discussion
----------
[FrameworkBundle] Simplified some code in the DI configuration
| Q | A
| ------------- | ---
| Branch? | 3.4
| Bug fix? | no
| New feature? | no <!-- please update src/**/CHANGELOG.md files -->
| BC breaks? | no <!-- see https://symfony.com/bc -->
| Deprecations? | no <!-- please update UPGRADE-*.md and src/**/CHANGELOG.md files -->
| Tests pass? | yes <!-- please add some, will be required by reviewers -->
| Fixed tickets | -
| License | MIT
| Doc PR | not needed
Commits
-------
e6d76bae9f
[FrameworkBundle] Simplified some code in the DI configuration
This commit is contained in:
commit
e07ed228b7
@ -585,10 +585,7 @@ class Configuration implements ConfigurationInterface
|
|||||||
->ifTrue(function ($v) { return \is_array($v) && isset($v['mime_type']); })
|
->ifTrue(function ($v) { return \is_array($v) && isset($v['mime_type']); })
|
||||||
->then(function ($v) { return $v['mime_type']; })
|
->then(function ($v) { return $v['mime_type']; })
|
||||||
->end()
|
->end()
|
||||||
->beforeNormalization()
|
->beforeNormalization()->castToArray()->end()
|
||||||
->ifTrue(function ($v) { return !\is_array($v); })
|
|
||||||
->then(function ($v) { return [$v]; })
|
|
||||||
->end()
|
|
||||||
->prototype('scalar')->end()
|
->prototype('scalar')->end()
|
||||||
->end()
|
->end()
|
||||||
->end()
|
->end()
|
||||||
@ -646,10 +643,7 @@ class Configuration implements ConfigurationInterface
|
|||||||
->fixXmlConfig('loader')
|
->fixXmlConfig('loader')
|
||||||
->children()
|
->children()
|
||||||
->arrayNode('loaders')
|
->arrayNode('loaders')
|
||||||
->beforeNormalization()
|
->beforeNormalization()->castToArray()->end()
|
||||||
->ifTrue(function ($v) { return !\is_array($v); })
|
|
||||||
->then(function ($v) { return [$v]; })
|
|
||||||
->end()
|
|
||||||
->prototype('scalar')->end()
|
->prototype('scalar')->end()
|
||||||
->end()
|
->end()
|
||||||
->end()
|
->end()
|
||||||
@ -674,10 +668,7 @@ class Configuration implements ConfigurationInterface
|
|||||||
->scalarNode('base_path')->defaultValue('')->end()
|
->scalarNode('base_path')->defaultValue('')->end()
|
||||||
->arrayNode('base_urls')
|
->arrayNode('base_urls')
|
||||||
->requiresAtLeastOneElement()
|
->requiresAtLeastOneElement()
|
||||||
->beforeNormalization()
|
->beforeNormalization()->castToArray()->end()
|
||||||
->ifTrue(function ($v) { return !\is_array($v); })
|
|
||||||
->then(function ($v) { return [$v]; })
|
|
||||||
->end()
|
|
||||||
->prototype('scalar')->end()
|
->prototype('scalar')->end()
|
||||||
->end()
|
->end()
|
||||||
->end()
|
->end()
|
||||||
@ -719,10 +710,7 @@ class Configuration implements ConfigurationInterface
|
|||||||
->scalarNode('base_path')->defaultValue('')->end()
|
->scalarNode('base_path')->defaultValue('')->end()
|
||||||
->arrayNode('base_urls')
|
->arrayNode('base_urls')
|
||||||
->requiresAtLeastOneElement()
|
->requiresAtLeastOneElement()
|
||||||
->beforeNormalization()
|
->beforeNormalization()->castToArray()->end()
|
||||||
->ifTrue(function ($v) { return !\is_array($v); })
|
|
||||||
->then(function ($v) { return [$v]; })
|
|
||||||
->end()
|
|
||||||
->prototype('scalar')->end()
|
->prototype('scalar')->end()
|
||||||
->end()
|
->end()
|
||||||
->end()
|
->end()
|
||||||
@ -817,10 +805,7 @@ class Configuration implements ConfigurationInterface
|
|||||||
->defaultValue(['loadValidatorMetadata'])
|
->defaultValue(['loadValidatorMetadata'])
|
||||||
->prototype('scalar')->end()
|
->prototype('scalar')->end()
|
||||||
->treatFalseLike([])
|
->treatFalseLike([])
|
||||||
->validate()
|
->validate()->castToArray()->end()
|
||||||
->ifTrue(function ($v) { return !\is_array($v); })
|
|
||||||
->then(function ($v) { return (array) $v; })
|
|
||||||
->end()
|
|
||||||
->end()
|
->end()
|
||||||
->scalarNode('translation_domain')->defaultValue('validators')->end()
|
->scalarNode('translation_domain')->defaultValue('validators')->end()
|
||||||
->booleanNode('strict_email')->end()
|
->booleanNode('strict_email')->end()
|
||||||
|
Reference in New Issue
Block a user