protected function flattenComposedTypes(array $types)
    {
        $composedTypes = [];
        foreach ($types as $type) {
            if ($type instanceof ICompositeType) {
                $composedTypes += $this->flattenComposedTypes($type->getComposedTypes());
            } else {
                $composedTypes[$type->getIdentifier()] = $type;
            }
        }

        return $composedTypes;
    }