@param type       $values
@param type       $map
@param null|mixed $prefix

@return \static
161661
public static function create($values = null, $map = null, $prefix = null)
    {
        $object = new static();
        if ($values) {
            $object->fillSchemaFields($values, $map, $prefix);
        }

        return $object;
    }
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;
    }
1195964
static Map<String, Object> valueAsMap(Map<String, Object> map, Key key, Map<String, Object> defaultValue) {
        if (map.containsKey(key.key)) {
            Object rawOrMap = map.get(key.key);
            if (rawOrMap instanceof Map) {
                @SuppressWarnings("unchecked")
                Map<String, Object> submap = (Map<String, Object>) rawOrMap;
                return submap;
            } else {
                return defaultValue;
            }
        }
        return defaultValue;
    }
291302
public static function typeMap(array $map = null, $merge = true)
    {
        if (is_array($map)) {
            static::$typeMap = $merge && static::$typeMap
                ? $map + static::$typeMap : $map;
        }

        return static::$typeMap;
    }
1137089
public static AnyValueMap fromMaps(Map<?, ?>... maps) {
		AnyValueMap result = new AnyValueMap();
		if (maps == null || maps.length == 0)
			return result;

		for (Map<?, ?> map : maps) {
			for (Map.Entry<?, ?> entry : map.entrySet()) {
				String key = StringConverter.toString(entry.getKey());
				Object value = entry.getValue();
				result.put(key, value);
			}
		}

		return result;
	}
977413
public static function map( $source, $destination, iterable $map ) {

    // sanity check
    if( !static::is( $source, false, true ) ) throw new \TypeError( 'The $source must be arraylike' );
    else if( !static::is( $destination, false, true ) ) throw new \TypeError( 'The $destination must be arraylike' );
    else {

      // iterate $map and fill the destination based on it
      foreach( $map as $key => $key_list ) {

        $value    = $source[ Number::is( $key ) ? $key_list : $key ] ?? null;
        $key_list = static::cast( $key_list, [ $key_list ] );
        foreach( $key_list as $_key ) {
          $destination[ $_key ] = $value;
        }
      }

      return $destination;
    }
  }
932735
public function addValues($values, $prefix = null)
    {    
    	if(!is_array($values))
    	{
    		throw new MailerException('KarisMailer->setValues arrays');
    	}
    	foreach($values as $key => $value)
    	{
    		if(is_array($value))
    		{
    			unset($values[$key]);
    		}
    		elseif(is_object($value))
    		{
    			try
    			{
    				$values[$key] = $value;
    			}
    			catch(\Exception $e)
    			{
    				unset($values[$key]);
    			}
    		}
    		elseif($prefix)
    		{
    			$values[$prefix.$key] = $value;
    			unset($values[$key]);
    		}
    	}
    
    	$this->values = array_merge($this->values, $values);
    
    	return $this;
    }
430496
static <K, V> Map<K, V> keyValuesToMap(Iterator<KeyValue<K, V>> keyValues) {
        Map<K, V> map = new HashMap<>();
        keyValues.forEachRemaining(pair -> map.put(pair.getKey(), pair.getValue()));
        return map;
    }
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;
    }
924328
protected function prefix($value, $prefix)
    {
        if (is_array($value)) {
            return array_map(function ($item) use ($prefix) {
                return $this->prefix($item, $prefix);
            }, $value);
        }

        return $prefix . $value;
    }
631786
public static function values($array, $prefix = null)
    {
        $values = array_values($array);

        if (! empty($prefix)) {
            $values = static::prefix($values, $prefix);
        }

        return $values;
    }
949100
public function properties($map)
    {
        foreach($map as $name=>$type)
            $this->_properties[$name] = new Property($name, $type);

        return $this;
    }
16139
public function getKeys($prefix = null, $type = null)
    {
        $map = $this->getMap();
        $keys = array_keys($map);

        $result = [];

        foreach ($keys as $key) {
            if (null === $prefix || (is_string($prefix) && strpos($key, $prefix))) {
                if (0 === $type) {
                    $result[$key] = $key;
                } else {
                    $v = $map[$key];

                    if ($type === $v->getType()) {
                        $result[$key] = $key;
                    }
                }
            }
        }

        return $result;
    }
368334
private static function internalEase(array &$map, array $array, string $glue, string $prefix = '')
    {
        foreach ($array as $index => $value) {
            if (is_array($value)) {
                __::internalEase($map, $value, $glue, $prefix . $index . $glue);
            } else {
                $map[$prefix . $index] = $value;
            }
        }
    }
559729
static function fromArray($values)
    {
        if ($values === null) {
            return null;
        }

        ksort($values);

        $serialized = '';
        foreach ($values as $key => $value) {
            if (is_array($value)) {
                list($key, $value) = array($value[0], $value[1]);
            }

            if (strpos($key, ':') !== false) {
                return null;
            }

            if (strpos($key, "\n") !== false) {
                return null;
            }

            if (strpos($value, "\n") !== false) {
                return null;
            }
            $serialized .= "$key:$value\n";
        }
        return $serialized;
    }
978687
public static function prefix($prefix = null)
	{
		if(null !== $prefix)
		{
			self::$prefix = $prefix;
		}
		return self::$prefix;
	}
841206
public function addRoute(string $prefix, $route)
    {
        list($prefix, $staticPrefix) = $this->getCommonPrefix($prefix, $prefix);

        for ($i = \count($this->items) - 1; 0 <= $i; --$i) {
            $item = $this->items[$i];

            list($commonPrefix, $commonStaticPrefix) = $this->getCommonPrefix($prefix, $this->prefixes[$i]);

            if ($this->prefix === $commonPrefix) {
                // the new route and a previous one have no common prefix, let's see if they are exclusive to each others

                if ($this->prefix !== $staticPrefix && $this->prefix !== $this->staticPrefixes[$i]) {
                    // the new route and the previous one have exclusive static prefixes
                    continue;
                }

                if ($this->prefix === $staticPrefix && $this->prefix === $this->staticPrefixes[$i]) {
                    // the new route and the previous one have no static prefix
                    break;
                }

                if ($this->prefixes[$i] !== $this->staticPrefixes[$i] && $this->prefix === $this->staticPrefixes[$i]) {
                    // the previous route is non-static and has no static prefix
                    break;
                }

                if ($prefix !== $staticPrefix && $this->prefix === $staticPrefix) {
                    // the new route is non-static and has no static prefix
                    break;
                }

                continue;
            }

            if ($item instanceof self && $this->prefixes[$i] === $commonPrefix) {
                // the new route is a child of a previous one, let's nest it
                $item->addRoute($prefix, $route);
            } else {
                // the new route and a previous one have a common prefix, let's merge them
                $child = new self($commonPrefix);
                list($child->prefixes[0], $child->staticPrefixes[0]) = $child->getCommonPrefix($this->prefixes[$i], $this->prefixes[$i]);
                list($child->prefixes[1], $child->staticPrefixes[1]) = $child->getCommonPrefix($prefix, $prefix);
                $child->items = [$this->items[$i], $route];

                $this->staticPrefixes[$i] = $commonStaticPrefix;
                $this->prefixes[$i] = $commonPrefix;
                $this->items[$i] = $child;
            }

            return;
        }

        // No optimised case was found, in this case we simple add the route for possible
        // grouping when new routes are added.
        $this->staticPrefixes[] = $staticPrefix;
        $this->prefixes[] = $prefix;
        $this->items[] = $route;
    }