The current behavior looks incorrect.
If I want to add
Filters, supportedLocales, for example, then my settings will overwrite the default data. But it would be logical to combine them.
PHP Code:
// before, globals filters
array(2) {
["before"]=>
array(3) {
[0]=>
string(8) "honeypot"
[1]=>
string(4) "csrf"
[2]=>
string(12) "invalidchars"
}
["after"]=>
array(1) {
[0]=>
string(13) "secureheaders"
}
}
// after Registrar
array(2) {
["before"]=>
array(1) {
[0]=>
string(23) "some_filter"
}
["after"]=>
array(0) {
}
// Expected
array(2) {
["before"]=>
array(4) {
[0]=>
string(8) "honeypot"
[1]=>
string(4) "csrf"
[2]=>
string(12) "invalidchars"
[3]=>
string(23) "some_filter"
}
["after"]=>
array(1) {
[0]=>
string(13) "secureheaders"
}
}
Am I wrong? Of course, you can manually combine the previous values with the new ones, but it doesn't look. good. It will probably cause recursion.
Should I change it to
array_merge_recursive()
Otherwise, you will have to duplicate all the values manually. This is bad for a modular system where each component changes arrays.