Skip to content
This repository has been archived by the owner on Jun 11, 2024. It is now read-only.

Rework abstract mapper to allow configure static type map in di.xml #125

Merged
merged 1 commit into from
Oct 11, 2019
Merged

Rework abstract mapper to allow configure static type map in di.xml #125

merged 1 commit into from
Oct 11, 2019

Conversation

bartoszherba
Copy link
Contributor

Currently staticFieldMapping is in private field which is not possible to extend or reach by any manner. Also no public can be plugined to add or change static mapping. Only overriding is viable but overriding is BAD as we all know and all classes attributes are private and also some methods are.

I moved staticFieldMapping from a private attribute to a constructor so anyone can configure list simply by adding or changing it from di.xml. That will make that class a little bit more open for changes (SOLID) without changing the class itself.

I encountered a real life scenario where I had to be sure that an attribute will be of given type and I did not find any good solution.

@afirlejczyk afirlejczyk merged commit 0bd2fc6 into vuestorefront:develop Oct 11, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants