Skip to content

Instantly share code, notes, and snippets.

@jaytaph
Created April 14, 2014 07:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jaytaph/10623105 to your computer and use it in GitHub Desktop.
Save jaytaph/10623105 to your computer and use it in GitHub Desktop.
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
@matthiasnoback
Copy link

You can use beforeNormalization on the foo node, to inspect values of both default_endpoint and endpoints, inside the closure throw an InvalidConfigurationException 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 of connections, but it does not validate anything!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment