Checking that types from array matching with [boolean, integer, string, double]
@param array $types Indexed array
@return bool
@throws LazerException
764587
public static function types(array $types)
    {
        $defined = array('boolean', 'integer', 'string', 'double');
        $diff    = array_diff($types, $defined);

        if (empty($diff))
        {
            return TRUE;
        }
        throw new LazerException('Wrong types: "' . implode(', ', $diff) . '". Available "boolean, integer, string, double"');
    }
1207432
public function filter(array $types = array())
    {
        $this->mergeTypes($types);

        $files = $this->getFiles();

        foreach ($files as $filename) {

            foreach (file($filename) as $lineNumber => $content) {
                foreach ($this->types as $type) {
                    if (stristr($content, "@$type")) {

                        // Strip note type text and comment tag
                        $content = preg_replace("/\S+(\s|\s\s+)$type(\s|\s\s+)/", '', $content);

                        // Strip excess whitespace (space or tab) in beginning string
                        $content = trim(preg_replace('/(\t+|\s\s+)/', '', $content));

                        $this->add(
                            new Line($filename, $lineNumber, $content, $type)
                        );
                    }
                }
            }
        }

        return $this->matches;
    }
1160783
public function type( $types )
	{
		if( !empty( $types ) ) {
			$this->conditions[] = $this->filter->compare( '==', 'stock.type', $types );
		}

		return $this;
	}
85894
public static function typeOf($types, ...$values): bool
    {
        if (is_string($types)) {
            $types = [$types];
        }

        if (is_array($types) === false) {
            throw new InvalidArgumentException(sprintf(static::MSG_TYPE_MISMATCH, gettype($types)));
        }

        foreach ($values as $value) {
            $isObject  = is_object($value);
            $match     = false;
            $valueType = gettype($value);

            // Check if current value is one of the specified types or instances
            foreach ($types as $type) {
                if (($isObject && $value instanceof $type) xor ($isObject === false && $valueType === $type)) {
                    $match = true;
                    break;
                }
            }

            // Throw type error
            if ($match === false) {
                if ($isObject) {
                    $message   = 'Expected value to be an instance of %s, instance of %s given!';
                    $valueType = get_class($value);
                } else {
                    $message = 'Expected value to be of type %s, %s given!';
                }

                throw new TypeError(sprintf($message, implode(' or ', $types), $valueType));
            }
        }

        return true;
    }
104006
public function hasAnyDynamicType($types)
    {
        if (\is_string($types)) {
            return isset($this->dynamicTypes[$types]);
        } else {
            foreach ($types as $type) {
                if (isset($this->dynamicTypes[$type])) {
                    return true;
                }
            }
        }

        return false;
    }
690832
protected function isTypeWithinArray($type, array $haystackTypes)
    {
        $iterator = new \ArrayIterator($haystackTypes);

        while($iterator->valid()) {
            $seenValue = $iterator->current();

            if ($seenValue === $type) {
                return true;
            }

            $parts = explode('.', $seenValue);
            if (count($parts) > 1) {
                array_shift($parts);

                $newKey = implode('.', $parts);
                $iterator->append($newKey);
            }

            $iterator->next();
        }

        return false;
    }
1031110
protected function extractTypeValues(array $data, array $types)
    {
        $typeValues = array();

        foreach ($data as $k => $_) {
            $typeValues[] = isset($types[$k])
                ? $types[$k]
                : \PDO::PARAM_STR;
        }

        return $typeValues;
    }
38396
public function defineMultiple(array $types)
    {
        foreach ($types as $type_name => $type_settings) {
            array_splice($type_settings, 1, 0, $type_name);

            call_user_func_array([$this, 'define'], $type_settings);
        }
    }
354710
public function hasCast($key, $types = null)
    {
        if (array_key_exists($key, $this->getCasts())) {
            return $types ? in_array($this->getCastType($key), (array) $types, true) : true;
        }

        return false;
    }
686345
protected static function is_numeric( $type ) {
		switch ( $type ) {
			case self::INT:
			case self::TINYINT:
			case self::MEDIUMINT:
			case self::BIGINT:
			case self::DOUBLE:
			case self::FLOAT:
			case self::REAL:
			case self::DECIMAL:
				return true;
				break;
			default:
				return false;
				break;
		}
	}
132380
protected function types(array $types): array
    {
        $results = [];
        foreach ($types as $type)
        {
            $results[] = $this->types[$type];
        }

        return $results;
    }
1090045
public static function create(array $types = [])
    {
        $expandedTypes = [];

        foreach ([Direction::SERIALIZATION, Direction::DESERIALIZATION] as $direction) {
            $expandedTypes[$direction] = isset($types[$direction]) ? $types[$direction] : [];
            unset($types[$direction]);
        }

        $types = array_merge([
            Type::ARRAY_    => new ArrayType(),
            Type::BOOL      => $booleanType = new BooleanType(),
            Type::BOOLEAN   => $booleanType,
            Type::CLOSURE   => new ClosureType(),
            Type::DATE_TIME => new DateTimeType(),
            Type::DOUBLE    => $floatType = new FloatType(),
            Type::EXCEPTION => new ExceptionType(),
            Type::FLOAT     => $floatType,
            Type::INT       => $integerType = new IntegerType(),
            Type::INTEGER   => $integerType,
            Type::NULL      => new NullType(),
            Type::NUMERIC   => $floatType,
            Type::OBJECT    => new ObjectType(),
            Type::RESOURCE  => new ResourceType(),
            Type::STD_CLASS => new StdClassType(),
            Type::STRING    => new StringType(),
        ], $types);

        foreach ($expandedTypes as &$innerTypes) {
            $innerTypes = array_merge($types, $innerTypes);
        }

        return new static($expandedTypes);
    }
490546
private function checkFormClass($type, $classes)
    {
        return array_filter($classes, function ($subclass) use ($type) {
            return is_a($type, $subclass, true);
        });
    }
1232652
private function doClear(array $types)
    {
        $cleared = [];
        $this->mf->enableCache(false);

        foreach ($types as $type) {
            $metadata = $this->mf->getMetadataForType($type);
            $this->mf->getCache()->evictMetadataFromCache($metadata);
            $cleared[] = $type;
        }

        $this->mf->enableCache(true);
        $this->mf->clearMemory();
        return $cleared;
    }
130077
public function isNextAny(array $types)
    {
        if (null === $this->next) {
            return false;
        }

        foreach ($types as $type) {
            if ($type === $this->next[2]) {
                return true;
            }
        }

        return false;
    }
513390
private function doWarm(array $types)
    {
        $warmed = [];
        $this->doClear($types);
        foreach ($types as $type) {
            $this->mf->getMetadataForType($type);
            $warmed[] = $type;
        }
        return $warmed;
    }
828109
public static function checkSchemaType($type)
    {
        if (isset(self::$_schemaTypes[$type])) {
            return self::$_schemaTypes[$type];
        } else {
            return false;
        }
    }