/** * Wrap the provided value inside a Map. * * @param array|ArrayObject|ArrayAccess|MapInterface $input * * @return ArrayAccessMap|ArrayList * @throws CoreException * @throws InvalidArgumentException */ public static function toMap($input) { Arguments::define(Boa::map())->check($input); if ($input instanceof MapInterface) { return $input; } if (is_array($input) || $input instanceof ArrayObject) { return new ArrayMap($input); } if ($input instanceof ArrayAccess) { return new ArrayAccessMap($input); } throw new CoreException('Unable to build Map'); }