Ensure persistence.driver option exists before validating
The driver option is not required by the configuration, so we should check for it the validation functions. If type_prototype is being used, there is a legitimate case where type definitions would not specify a driver. Likewise, the type_prototype may not specify the driver. If we wish to validate that a driver has been specified for a type, we'll have to do that in the extension class after loading the configuration and merging in prototypes.
This commit is contained in:
parent
5f83fd90c2
commit
b21e063c9c
|
@ -74,9 +74,9 @@ class Configuration
|
|||
->children()
|
||||
->arrayNode('persistence')
|
||||
->validate()
|
||||
->ifTrue(function($v) { return 'propel' === $v['driver'] && isset($v['listener']); })
|
||||
->ifTrue(function($v) { return isset($v['driver']) && 'propel' === $v['driver'] && isset($v['listener']); })
|
||||
->thenInvalid('Propel doesn\'t support listeners')
|
||||
->ifTrue(function($v) { return 'propel' === $v['driver'] && isset($v['repository']); })
|
||||
->ifTrue(function($v) { return isset($v['driver']) && 'propel' === $v['driver'] && isset($v['repository']); })
|
||||
->thenInvalid('Propel doesn\'t support the "repository" parameter')
|
||||
->end()
|
||||
->children()
|
||||
|
@ -149,9 +149,9 @@ class Configuration
|
|||
->children()
|
||||
->arrayNode('persistence')
|
||||
->validate()
|
||||
->ifTrue(function($v) { return 'propel' === $v['driver'] && isset($v['listener']); })
|
||||
->ifTrue(function($v) { return isset($v['driver']) && 'propel' === $v['driver'] && isset($v['listener']); })
|
||||
->thenInvalid('Propel doesn\'t support listeners')
|
||||
->ifTrue(function($v) { return 'propel' === $v['driver'] && isset($v['repository']); })
|
||||
->ifTrue(function($v) { return isset($v['driver']) && 'propel' === $v['driver'] && isset($v['repository']); })
|
||||
->thenInvalid('Propel doesn\'t support the "repository" parameter')
|
||||
->end()
|
||||
->children()
|
||||
|
|
Loading…
Reference in a new issue