This repository was archived by the owner on Feb 6, 2020. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +4
-30
lines changed Expand file tree Collapse file tree 1 file changed +4
-30
lines changed Original file line number Diff line number Diff line change 9
9
10
10
namespace Zend \ServiceManager ;
11
11
12
- use Zend \Stdlib \ArrayUtils ;
13
-
14
12
class Config implements ConfigInterface
15
13
{
16
- /**
17
- * Allowed configuration keys
18
- *
19
- * @var array
20
- */
21
- protected $ allowedKeys = [
22
- 'abstract_factories ' => true ,
23
- 'aliases ' => true ,
24
- 'delegators ' => true ,
25
- 'factories ' => true ,
26
- 'initializers ' => true ,
27
- 'invokables ' => true ,
28
- 'lazy_services ' => true ,
29
- 'services ' => true ,
30
- 'shared ' => true ,
31
- ];
32
-
33
14
/**
34
15
* @var array
35
16
*/
@@ -46,27 +27,20 @@ class Config implements ConfigInterface
46
27
];
47
28
48
29
/**
49
- * Constructor
50
- *
51
30
* @param array $config
52
31
*/
53
32
public function __construct (array $ config = [])
54
33
{
55
34
// Only merge keys we're interested in
56
- foreach (array_keys ($ config ) as $ key ) {
57
- if (! isset ($ this -> allowedKeys [ $ key ])) {
58
- unset( $ config [$ key ]) ;
35
+ foreach (array_keys ($ this -> config ) as $ requiredKey ) {
36
+ if (isset ($ config [ $ requiredKey ])) {
37
+ $ this -> config [$ requiredKey ] = $ config [ $ requiredKey ] ;
59
38
}
60
39
}
61
-
62
- $ this ->config = ArrayUtils::merge ($ this ->config , $ config );
63
40
}
64
41
65
42
/**
66
- * Configure service manager
67
- *
68
- * @param ServiceManager $serviceManager
69
- * @return ServiceManager Returns the updated service manager instance.
43
+ * @inheritdoc
70
44
*/
71
45
public function configureServiceManager (ServiceManager $ serviceManager )
72
46
{
You can’t perform that action at this time.
0 commit comments