Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug with array_merge_recursive #4

Closed
weierophinney opened this issue Dec 31, 2019 · 2 comments
Closed

Bug with array_merge_recursive #4

weierophinney opened this issue Dec 31, 2019 · 2 comments

Comments

@weierophinney
Copy link
Member

I'm trying to do something like this:

$config1 = [
    'factories`=> [
        // factories
    ],
    'lazy_services' => [
        'class_map' => [
            'Foo' => 'Foo',
        ],
    ],
];
$config2 = [
    'factories`=> [
        // factories
    ],
    'lazy_services' => [
        'class_map' => [
            'Foo' => 'Foo',
        ],
    ],
];

$container = new ServiceManager($config1);
$container->configure($config2);

This will result on internal lazy_services property the following:

$this->lazy_services = [
    'class_map' => [
        'Foo' => [
            'Foo',
            'Foo',
        ],
    ].
];

The problem is the use of array_merge_recursive() function in this line.

Same problem with delegators property.

I found this issue using zend-mvc and an already configured container, then Zend\ModuleManager\Listener\ServiceListener reconfigure it adding configuration from ModuleManager features.


Originally posted by @thomasvargiu at zendframework/zend-servicemanager#279

@GeeH
Copy link
Contributor

GeeH commented Jun 5, 2020

Dupe of #3 fixed by #43

@settermjd
Copy link

I have a similar issue with delegators and have a simple patch for it. Just need help with testing the change.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants