From b9222cf42174109b967b4030f706a9ab5bce2b85 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Federico=20Jaramillo=20Mart=C3=ADnez?= Date: Thu, 11 Oct 2018 10:09:40 -0500 Subject: [PATCH 1/2] Example to override a value that is an array. Add an example for how to override a configuration value that has is array. --- .../04_Configuration/00_Configuration.md | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/docs/en/02_Developer_Guides/04_Configuration/00_Configuration.md b/docs/en/02_Developer_Guides/04_Configuration/00_Configuration.md index 98d9438e5..e0b420479 100644 --- a/docs/en/02_Developer_Guides/04_Configuration/00_Configuration.md +++ b/docs/en/02_Developer_Guides/04_Configuration/00_Configuration.md @@ -156,7 +156,21 @@ rules: - If the value is an array, each array is added to the _beginning_ of the composite array in ascending priority order. If a higher priority item has a non-integer key which is the same as a lower priority item, the value of those items is merged using these same rules, and the result of the merge is located in the same location the higher priority item - would be if there was no key clash. Other than in this key-clash situation, within the particular array, order is preserved. + would be if there was no key clash. Other than in this key-clash situation, within the particular array, order is preserved. To override a value that is an array, the value must first be set to `null`, and then set again to the new array. +```yml +--- +Name: rulereset +--- +Class\With\Array\Config: + an_array: null +--- +Name: rule +--- +Class\With\Array\Config: + an_array: ['value_a', 'value_b'] +--- +``` + - If the value is not an array, the highest priority value is used without any attempt to merge From 8e5ca9be38ea324fd90e98d5eae233b9609def70 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Federico=20Jaramillo=20Mart=C3=ADnez?= Date: Thu, 11 Oct 2018 10:12:38 -0500 Subject: [PATCH 2/2] Change rule names in array example --- .../02_Developer_Guides/04_Configuration/00_Configuration.md | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/docs/en/02_Developer_Guides/04_Configuration/00_Configuration.md b/docs/en/02_Developer_Guides/04_Configuration/00_Configuration.md index e0b420479..2fe1e29f4 100644 --- a/docs/en/02_Developer_Guides/04_Configuration/00_Configuration.md +++ b/docs/en/02_Developer_Guides/04_Configuration/00_Configuration.md @@ -159,16 +159,15 @@ rules: would be if there was no key clash. Other than in this key-clash situation, within the particular array, order is preserved. To override a value that is an array, the value must first be set to `null`, and then set again to the new array. ```yml --- -Name: rulereset +Name: arrayreset --- Class\With\Array\Config: an_array: null --- -Name: rule +Name: array --- Class\With\Array\Config: an_array: ['value_a', 'value_b'] ---- ``` - If the value is not an array, the highest priority value is used without any attempt to merge