Skip to content
This repository was archived by the owner on Feb 6, 2020. It is now read-only.

Commit b229413

Browse files
committed
Remove Zend\Stdlib dependency and simplify config implementation
1 parent 97dfca5 commit b229413

File tree

1 file changed

+4
-30
lines changed

1 file changed

+4
-30
lines changed

src/Config.php

Lines changed: 4 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -9,27 +9,8 @@
99

1010
namespace Zend\ServiceManager;
1111

12-
use Zend\Stdlib\ArrayUtils;
13-
1412
class Config implements ConfigInterface
1513
{
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-
3314
/**
3415
* @var array
3516
*/
@@ -46,27 +27,20 @@ class Config implements ConfigInterface
4627
];
4728

4829
/**
49-
* Constructor
50-
*
5130
* @param array $config
5231
*/
5332
public function __construct(array $config = [])
5433
{
5534
// 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];
5938
}
6039
}
61-
62-
$this->config = ArrayUtils::merge($this->config, $config);
6340
}
6441

6542
/**
66-
* Configure service manager
67-
*
68-
* @param ServiceManager $serviceManager
69-
* @return ServiceManager Returns the updated service manager instance.
43+
* @inheritdoc
7044
*/
7145
public function configureServiceManager(ServiceManager $serviceManager)
7246
{

0 commit comments

Comments
 (0)