converts the given map to a list

@param mixed[]|array<mixed> $map
@return mixed[]|array<mixed>
@internal
15267
public function mapToList($map)
    {
        $list = array();
        foreach ($map as $key => $value) {
            // explicitly pass key as UTF-8 byte array
            // pass value with automatic type detection
            $list []= new QVariant($key, Types::TYPE_QBYTE_ARRAY);
            $list []= $value;
        }
        return $list;
    }
1200784
public static function toList($collection) {
		$list = new ArrayList();
		foreach ($collection as $v) {
			$list->add(self::toCollection($v));
		}
		return $list;
	}
228780
public function mapParams(array $map, $params = null)
    {
        if (!isset($params)) {
            $params = $this->params;
        }

        $mapped = array();

        foreach ($params as $key => $value) {
            if (isset($map[$key]) && is_string($map[$key])) {
                gplcart_array_set($mapped, $map[$key], $value);
            }
        }

        return $mapped;
    }
777164
public static function mapKey($origin, $map = [])
    {
        $result = is_array($origin) ? [] : new \stdClass();

        foreach ((array) $origin as $key => $val) {
            $newKey = self::getValue($map, $key);

            if ($newKey) {
                self::setValue($result, $newKey, $val);
            } else {
                self::setValue($result, $key, $val);
            }
        }

        return $result;
    }
256060
public function mergeMapWithBinded( $map ) {

		foreach( $map as $key => $value ) {

			if( !in_array( $key, $this->binded ) ) {

				$this->binded[] = $key;
				$this->value[]	= $value;
			}
		}
	}
737740
public function listToMap(array $list)
    {
        $map = array();
        for ($i = 0, $n = count($list); $i < $n; $i += 2) {
            $map[$list[$i]] = $list[$i + 1];
        }
        return (object)$map;
    }
735146
public static function hashMap($map)
    {
        $cache = '';
        foreach ($map as $key => $value) {
            $cache .= 0xAB01 . $key . 0xAB02;
            if (is_array($value)) {
                $cache .= 0xAB04 . static::hashMap($value);
            } else {
                $cache .= 0xAB03 . $value;
            }
        }
        return md5($cache);
    }
658004
public function collect(Map $map, array $extendables = [])
    {
        foreach ($map->getBound()->getExtendables() as $extendable) {
            if ($extendable instanceof Marker || $extendable instanceof Polyline) {
                $extendables = $this->collectValue($extendable, $extendables);
            }
        }

        return $extendables;
    }
176116
public function render(array $map)
    {
        foreach ($map as $aliasName => $value) {
            $this->templateVariableContainer->add($aliasName, $value);
        }
        $output = $this->renderChildren();
        foreach ($map as $aliasName => $value) {
            $this->templateVariableContainer->remove($aliasName);
        }
        return $output;
    }
590019
public function collect(Map $map, array $bounds = [])
    {
        if ($map->isAutoZoom()) {
            $bounds = $this->collectValue($map->getBound(), $bounds);
        }

        foreach ($this->groundOverlayCollector->collect($map) as $groundOverlay) {
            $bounds = $this->collectValue($groundOverlay->getBound(), $bounds);
        }

        foreach ($this->rectangleCollector->collect($map) as $rectangle) {
            $bounds = $this->collectValue($rectangle->getBound(), $bounds);
        }

        return $bounds;
    }
330769
public static function map(array $object, array $map)
    {
        $result = [];

        foreach ($map as $from => $to) {
            if ( ! isset($object[$from])) {
                continue;
            }

            $result[$to] = $object[$from];
        }

        return $result;
    }
968003
public function provide(
        string $reference,
        array $map = []
    ) {
        $request = $this->requestType == self::CURRENT_REQUEST
            ? $this
                ->requestStack
                ->getCurrentRequest()
            : $this
                ->requestStack
                ->getMasterRequest();

        if ($request instanceof Request) {
            foreach ([
                '~' => $request->attributes,
                '#' => $request->request,
                '?' => $request->query,
            ] as $symbol => $parameterBag) {
                $value = $this->resolveValueFromParameterBag(
                    $parameterBag,
                    $symbol,
                    $reference
                );

                if ($value !== $reference) {
                    return is_array($map) && isset($map[$value])
                        ? $map[$value]
                        : $value;
                }
            }
        }

        return $reference;
    }
1060248
public function collect(Map $map, array $markers = [])
    {
        return $this->collectValues($map->getOverlayManager()->getMarkers(), $markers);
    }
423953
public function collect(Map $map, array $kmlLayers = [])
    {
        return $this->collectValues($map->getLayerManager()->getKmlLayers(), $kmlLayers);
    }
914742
public static function mapList( $list, $map, ?string $key = null ): array {

    if( !static::is( $list, true ) ) throw new \TypeError( 'The $list must be iterable' );
    else {

      $_list = [];
      foreach( $list as $index => $item ) {

        if( !static::is( $item, false, true ) ) throw new \TypeError( 'All $list element must be arraylike' );
        else {

          $_key = $key ? $item[ $key ] : $index;
          if( !static::is( $map, true, true ) ) $_list[ $_key ] = $item[ $map ] ?? null;
          else $_list[ $_key ] = static::map( $item, [], $map );
        }
      }

      return $_list;
    }
  }
1114259
protected function getMappedKey($map, $key)
    {
        if (is_array($map)) {
            if (array_key_exists($key, $map)) {
                return $map[$key];
            } else {
                return $key;
            }
        }
        return $key;
    }
898208
public function getFileList( PackageInterface $package, $map ) {
    $directory = $this->getDirectory( $package );
    $result    = [];

    try {

      foreach( $map as $source => $destination ) {
        if( !is_dir( $directory . $source ) ) $result[ $directory . $source ] = Autoload::DIRECTORY . $destination;
        else {

          $iterator = new \RecursiveIteratorIterator(
            new \RecursiveDirectoryIterator( $directory . $source, \RecursiveDirectoryIterator::SKIP_DOTS ),
            \RecursiveIteratorIterator::SELF_FIRST
          );

          foreach( $iterator as $item ) {
            /** @var SplFileInfo $item */
            if( !$item->isDir() ) {
              $result[ $item->getRealPath() ] = Autoload::DIRECTORY . $destination . DIRECTORY_SEPARATOR . call_user_func( [ $iterator, 'getSubPathName' ] );
            }
          }
        }
      }

    } catch( \Throwable $e ) {
      $this->io->writeError( "Spoom\\Composer: Skip {$package->getPrettyName()} public copy, due to an error" );
    }

    return $result;
  }