Replaces Static Types by the provided Static Type.

@param  array $types
@param  string $staticType
@return array
332747
private function replaceStaticType(array $types, string $staticType): array
    {
        $mixins = array_merge(
            [Model::class],
            $this->mixins->getMixinsFromClass($this->broker, $this->broker->getClass(Model::class))
        );

        foreach ($types as $key => $type) {
            if ($type instanceof ObjectType && in_array($type->getClassName(), $mixins, true)) {
                $types[$key] = new StaticType($staticType);
            }

            if ($type instanceof StaticType) {
                $types[$key] = new StaticType($staticType);
            }

            if ($type instanceof IterableType) {
                $types[$key] = $type->changeBaseClass($staticType);
            }

            if ($type instanceof IntersectionType) {
                $types[$key] = new IntersectionType($this->replaceStaticType($type->getTypes(), $staticType));
            }
        }

        return $types;
    }
632380
public static function asType($type, array $data)
    {
        $converter = new TypeStringListConverter($type);
        $converter->setArraySource($data);
        return new static($converter);
    }
1267118
public function setType($type) {
        $types = [static::TYPE_DEFINED_ONLY, static::TYPE_ARBITRARY];
        if (in_array($type, $types)) {
            $this->type = $type;
        }
        return $this;
    }
282011
public function ElementsByItemType( $types )
	{
		if ( is_string( $types ) )
			$types = array_map( 'trim', explode( ",", $types ) );

		if ( ! is_array( $types ) )
			throw new Exception( 'InstanceElementsFilter::ElementsByName $types must be a string or array' );

		$types = array_flip( array_map( 'strtolower', $types ) );

		// In PHP 7.0 $this is passed to closure functions automatically but not in earlier versions
		$elements = &$this->elements;

		$filtered = array_reduce( array_keys( $this->elements ), function( $carry, $elementName ) use( &$elements, $types  ) {

			$namespaceElements = array_filter( $elements[ $elementName ], function( $entry ) use( $types ) {
				$type = $entry['taxonomy_element']['type'];
				return isset( $types[ strtolower( $type ) ] );
			} );

			if ( ! $namespaceElements ) return $carry;

			$carry[ $elementName ] = $namespaceElements;

			return $carry;

		}, array() );

		return new InstanceElementsFilter( $this->instance, $filtered );
	}
1313583
public function createFromArray(array $types)
    {
        foreach ($types as $type) {
            $this->collection->add(Type::fromString($type));
        }

        return $this->collection;
    }
326860
public static function typed(string $type, iterable $input = []): Vector
    {
        $resolver = Resolver::typed($type);

        return new static($input, $resolver);
    }
1071377
public static function typeAncestryForType(ResolvedFormTypeInterface $formType = null, array &$types)
    {
        if (!($formType instanceof ResolvedFormTypeInterface)) {
            return;
        }

        $types[] = $formType->getBlockPrefix();

        self::typeAncestryForType($formType->getParent(), $types);
    }
565178
public function setDynamicTypes($types)
    {
        if ($types) {
            unset($this->dynamicTypes['unknown']);

            if (\is_string($types)) {
                if (!isset($this->dynamicTypes[$types])) {
                    $this->dynamicTypes[$types] = true;
                }
            } else {
                foreach ($types as $type => $one) {
                    if (!isset($this->dynamicTypes[$one])) {
                        $this->dynamicTypes[$one] = true;
                    }
                }
            }
        }
    }
50600
public static function __static()
	{
		ValueProxy::$valueFactory = array();
		ValueProxy::$dynamicValueType = Type::FromNameAndTypeCode( ValueProxy::$CLASSNAME, TypeCode::Object );
	}
1300596
public function get(string $type): array
    {
        try {
            return $this->converters[$this->resolveType($type)];
        } catch (\Throwable $t) {
            throw new InvalidTypeConverterException(
                sprintf('Invalid converter type `%s`.', $type)
            );
        }
    }
712468
public function unregisterObjects($types)
    {
        if (!is_array($types)) {
            $types = [ $types ];
        }

        // Filter all objects
        foreach ($this->serviceCache as $key => $object) {
            foreach ($types as $filterClass) {
                // Prevent destructive flushing
                if (strcasecmp($filterClass, 'object') === 0) {
                    throw new InvalidArgumentException("Global unregistration is not allowed");
                }
                if ($object instanceof $filterClass) {
                    $this->unregisterNamedObject($key);
                    break;
                }
            }
        }
        return $this;
    }
963089
public function setAllowedMimeTypes($types = '*')
        {
            if(is_string($types))
            {
                if ('*' !== $types) {
                    $types = (array) $types;
                }else{
                    $this->allowedTypes = $types;
                    return $this;
                }
            }

            if(is_array($types))
            {
                $this->allowedTypes = $types;
                return $this;
            }else{
                return false;
            }
        }
1100864
public function setType($types)
    {
        if (!is_array($types)) {
            $types = [$types];
        }

        $typesToSet = [];
        foreach ($types as $type) {
            if ($type === 'int') {
                $type = 'integer';
            }
            if ($type === 'hash') {
                $type = 'object';
            }

            // handle non-primitive types
            if (!in_array($type, $this->primitiveTypes)) {
                $setType = 'string';
                if (isset($this->specialTypeMapping[$type])) {
                    $setType = $this->specialTypeMapping[$type];
                }
                $typesToSet[] = $setType;

                if (isset($this->formatOverrides[$type])) {
                    $type = $this->formatOverrides[$type];
                }

                $this->setFormat($type);
            } else {
                $typesToSet[] = $type;
            }
        }

        $this->type = new SchemaType($typesToSet);
    }
763492
public function bind($bindings, $type = [])
	{
		$idx = 1;

		$this->bindings = $bindings;

		foreach ($bindings as $binding)
		{
			// We use bindValue here because that allows us to pass in plain old strings
			$this->statement->bindValue(
				$idx,
				$binding,
				isset($type[$idx]) ? $this->translateType($type[$idx]) : $this->inferType($binding)
			);

			$idx++;
		}

		return $this;
	}
873602
public function getBestResponseType(array $types)
    {
        if (empty($types))
            return "";

        $this->sortTypes($types);
        $type = reset($types);
        return $this->accepts($type) ? current($types) : null;
    }
20226
public static function __static()
	{
		// NameValue::$nameStartChar = "[:_\p{Ll}\p{Lu}\p{Lt}\p{Lo}\p{Nl}]";
		NameValue::$nameStartChar = SchemaTypes::$nameStartChar;
		NameValue::$nameChar = SchemaTypes::$nameChar;
		NameValue::$name = SchemaTypes::$name;
		NameValue::$ncName = SchemaTypes::$ncName;
	}
71423
public static function typed(string $type, iterable $input = []): Deque
    {

        $resolver = Resolver::typed($type);

        return new static($input, $resolver);
    }