Open JeroenDeDauw opened 6 years ago
What about two empty interfaces MapDifferInterface
and ListDifferInterface
so the code
return new Diff( $this->listDiffer->doDiff( $old, $new ), $this->listDiffer instanceof MapDifferInterface);
would be appropriate
That is not elegant, but it
So yeah, adding a MapDifferInterface
seems OK. I'm really not a fan of the name though. You want to make a PR that adds MapDifferInterface
? (no need for ListDifferInterface
at this point as far as I can tell)
Background: the map/list distinction was not present in the very first versions as got hacked in, leaving something that is not explicit and clean.
Terms:
Pain points:
$isAssociative
flag, though constructing it with this set to false AND associative operations results in no error