Created
April 14, 2014 07:07
-
-
Save jaytaph/10623105 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
foo: | |
default_endpoint: endpoint_1 # this endpoint *must* be defined inside the endpoints array | |
endpoints: | |
- name: endpoint_1 | |
value: some_endpoint_1_data | |
- name: endpoint_2 | |
value: some_endpoint_2_data | |
- name: endpoint_3 | |
value: some_endpoint_3_data |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
You can use
beforeNormalization
on thefoo
node, to inspect values of bothdefault_endpoint
andendpoints
, inside the closure throw anInvalidConfigurationException
to indicate a problem with the keys.Or you can just validate values in the container extension class itself, after everything is parsed (seems not very "strict" to me, but I don't think it really matters here because configuration and extension are always used together, never stand-alone.
By the way, DoctrineBundle has the same thing:
default_connection
and an array ofconnections
, but it does not validate anything!