This repository has been archived by the owner on Jan 30, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 41
MapNamingStrategy vs. ArrayMapNamingStrategy #9
Comments
I see no reason for this. Because:
Right. |
What's interesting is that they operate in the exact opposite fashion with regards to the required initial constructor argument. With With As such, we would need to do a constructor that looks like this: function (?array $extractionMap = null, ?array $hydrationMap = null) I'll start work on this immediately. |
weierophinney
added a commit
to weierophinney/zend-hydrator
that referenced
this issue
Nov 29, 2018
Per zendframework#9, the two perform almost identical functionality; the main difference is _which argument is first in the constructor_, and the fact that `MapNamingStrategy` allowed a second argument for the opposite direction. This patch merges the two into `MapNamingStrategy`. The class is now final (as was `ArrayMapNamingStrategy`, and accepts either a `$hydrationMap` or an `$extractionMap` or both. If both are missing, it raises an exception. If one or the other is missing, the value becomes that of the `array_flip` of the other value present. The patch includes a migration document section detailing the changes, and expands the `MapNamingStrategy` documentation to cover all use cases.
weierophinney
added a commit
to weierophinney/zend-hydrator
that referenced
this issue
Dec 3, 2018
Per zendframework#9, the two perform almost identical functionality; the main difference is _which argument is first in the constructor_, and the fact that `MapNamingStrategy` allowed a second argument for the opposite direction. This patch merges the two into `MapNamingStrategy`. The class is now final (as was `ArrayMapNamingStrategy`, and accepts either a `$hydrationMap` or an `$extractionMap` or both. If both are missing, it raises an exception. If one or the other is missing, the value becomes that of the `array_flip` of the other value present. The patch includes a migration document section detailing the changes, and expands the `MapNamingStrategy` documentation to cover all use cases.
Fixed with #82, and will be shipped with 3.0.0. |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Do we need both? From what I can deduce (from source and the PR that introduced ArrayMapNamingStrategy) they're nearly identical except:
The text was updated successfully, but these errors were encountered: