瀏覽代碼

Fixed previous commit

Christophe Coevoet 14 年之前
父節點
當前提交
893bafdcc5
共有 1 個文件被更改,包括 6 次插入0 次删除
  1. 6 0
      src/Symfony/Bundle/MonologBundle/DependencyInjection/Configuration.php

+ 6 - 0
src/Symfony/Bundle/MonologBundle/DependencyInjection/Configuration.php

@@ -66,10 +66,16 @@ class Configuration
                         ->scalarNode('level')->defaultValue('DEBUG')->end()
                         ->booleanNode('bubble')->defaultFalse()->end()
                         ->scalarNode('path')->end() // stream specific
+                        ->validate()
+                            ->ifTrue(function($v) { return 'stream' === $v['type'] && !isset($v['path']); })
+                            ->thenInvalid('The path has to be specified to use a StreamHandler')
+                        ->end()
                     ->end()
                     ->validate()
                         ->ifTrue(function($v) { return 'fingerscrossed' === $v['type'] && !isset($v['handler']); })
                         ->thenInvalid('The handler has to be specified to use a FingersCrossedHandler')
+                    ->end()
+                    ->validate()
                         ->ifTrue(function($v) { return 'stream' === $v['type'] && !isset($v['path']); })
                         ->thenInvalid('The path has to be specified to use a StreamHandler')
                     ->end()