I have lots of bundles which have similar config files called rules.yml held in BundleName/Resources/config/rules.yml Each config file follows the same structure:
bundle_name:
rules:
name:
items: []
requirements: []
I have one bundle called RulerBundle. This bundle needs to automatically load, validate and combine all the rules.yml found within the other bundles. I would like RulerBundle to produce something like:
bundle_a:
rules:
name: Rule 1
items: ['First Item']
requirements: ['Second Item', 'Third Item']
bundle_b:
rules:
name: Rule 2
items: ['Second Item']
requirements: ['Third Item']
This should be automatically updated when a new bundle is added with a rules.yml
Questions
Should I validate and process the config within every bundle? This will lead to code duplication as the validation rules will just be same.
How would I go about finding and merging each of the bundle configs with the RulerBundle