/** * Merge this map with another map and return a new MapInterface. * * Values in $map will overwrite values in this instance. Any number of additional maps may * be passed to this method, i.e. $map->merge($map2, $map3, $map4, ...); * * @param MapInterface $map * * @return MapInterface */ public function merge(MapInterface $map) { $maps = array_slice(func_get_args(), 1); $data = array_reduce($maps, 'array_merge', array_merge($this->map, $map->getMapData())); return new self($data, $this->logger); }