Skip to content

Commit f669c95

Browse files
committed
Validate that service handlers can not have a formatter set, fixes #50
1 parent b1eaa2e commit f669c95

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

DependencyInjection/Configuration.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -392,6 +392,10 @@ public function getConfigTreeBuilder()
392392
->end()
393393
->scalarNode('formatter')->end()
394394
->end()
395+
->validate()
396+
->ifTrue(function($v) { return 'service' === $v['type'] && !empty($v['formatter']); })
397+
->thenInvalid('Service handlers can not have a formatter configured in the bundle, you must reconfigure the service itself instead')
398+
->end()
395399
->validate()
396400
->ifTrue(function($v) { return ('fingers_crossed' === $v['type'] || 'buffer' === $v['type']) && 1 !== count($v['handler']); })
397401
->thenInvalid('The handler has to be specified to use a FingersCrossedHandler or BufferHandler')

0 commit comments

Comments
 (0)