This repository was archived by the owner on Feb 6, 2020. It is now read-only.
File tree 1 file changed +4
-18
lines changed
1 file changed +4
-18
lines changed Original file line number Diff line number Diff line change @@ -50,15 +50,12 @@ class Config implements ConfigInterface
50
50
public function __construct (array $ config = [])
51
51
{
52
52
// Only merge keys we're interested in
53
- foreach (array_keys ($ this ->allowedKeys ) as $ requiredKey ) {
54
- if ($ this ->isValidValue ($ config , $ requiredKey )) {
55
- if ($ this ->isValidValue ($ this ->config , $ requiredKey )) {
56
- $ this ->config [$ requiredKey ] = $ this ->merge ($ this ->config [$ requiredKey ], $ config [$ requiredKey ]);
57
- } else {
58
- $ this ->config [$ requiredKey ] = $ config [$ requiredKey ];
59
- }
53
+ foreach (array_keys ($ config ) as $ key ) {
54
+ if (! isset ($ this ->allowedKeys [$ key ])) {
55
+ unset($ config [$ key ]);
60
56
}
61
57
}
58
+ $ this ->config = $ this ->merge ($ this ->config , $ config );
62
59
}
63
60
64
61
/**
@@ -77,17 +74,6 @@ public function toArray()
77
74
return $ this ->config ;
78
75
}
79
76
80
- /**
81
- * @param array $array
82
- * @param string $key
83
- *
84
- * @return bool
85
- */
86
- private function isValidValue (array $ array , $ key )
87
- {
88
- return isset ($ array [$ key ]) && is_array ($ array [$ key ]);
89
- }
90
-
91
77
/**
92
78
* Copy paste from https://github.com/zendframework/zend-stdlib/commit/26fcc32a358aa08de35625736095cb2fdaced090
93
79
* to keep compatibility with previous version
You can’t perform that action at this time.
0 commit comments