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

It's not possible to add multiple single file units to the same unit-type #15

Closed
Gummibeer opened this issue Feb 20, 2020 · 0 comments · Fixed by #16
Closed

It's not possible to add multiple single file units to the same unit-type #15

Gummibeer opened this issue Feb 20, 2020 · 0 comments · Fixed by #16

Comments

@Gummibeer
Copy link

Right now it's not possible to add multiple single file units to the same unittype.

UnitMap::add('Unit1.php', '\\MyUnits', Length::class);
UnitMap::add('Unit2.php', '\\MyUnits', Length::class);

The problem is

self::$map = self::$map + $classes;

Instead of $array + $array it should use array_merge_recursive(). This will merge the arrays on the level they should get merged - the array of units in the unit-type.

@pimlie pimlie closed this as completed in #16 Mar 5, 2020
pimlie added a commit that referenced this issue Mar 5, 2020
* add unittest for #15

* add fix for #15

* fix static/shared state between tests
pimlie added a commit that referenced this issue Mar 5, 2020
* add unittest for #15

* add fix for #15

* fix static/shared state between tests
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

Successfully merging a pull request may close this issue.

1 participant