Skip to content

Commit

Permalink
Merge pull request #1056 from FriendsOfSymfony/version_regexp
Browse files Browse the repository at this point in the history
fix indention and add missing end()
  • Loading branch information
lsmith77 committed Jun 3, 2015
2 parents e620c99 + 6165a96 commit ea4f6f6
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 11 deletions.
12 changes: 7 additions & 5 deletions DependencyInjection/Configuration.php
Original file line number Diff line number Diff line change
Expand Up @@ -279,11 +279,13 @@ private function addFormatListenerSection(ArrayNodeDefinition $rootNode)
->arrayNode('media_type')
->canBeEnabled()
->beforeNormalization()
->ifString()->then(function($v) { return array('enabled' => true, 'version_regex' => $v); })
->end()
->children()
->scalarNode('service')->defaultNull()->end()
->scalarNode('version_regex')->defaultValue('/(v|version)=(?P<version>[0-9\.]+)/')->end()
->ifString()
->then(function ($v) { return array('enabled' => true, 'version_regex' => $v); })
->end()
->children()
->scalarNode('service')->defaultNull()->end()
->scalarNode('version_regex')->defaultValue('/(v|version)=(?P<version>[0-9\.]+)/')->end()
->end()
->end()
->end()
->end()
Expand Down
9 changes: 3 additions & 6 deletions Resources/doc/configuration-reference.rst
Original file line number Diff line number Diff line change
Expand Up @@ -117,9 +117,6 @@ Full default configuration
exception_fallback_format: null
priorities: []
media_type:
version_regex:
enabled: false
service: null
regex: '/(v|version)=(?P<version>[0-9\.]+)/'
enabled: false
service: null
version_regex: '/(v|version)=(?P<version>[0-9\.]+)/'

0 comments on commit ea4f6f6

Please sign in to comment.