getFullyQualifiedName()), 'class'); } elseif ($type instanceof ObjectType) { $classConstTypes[] = new ClassConstFetch(new FullyQualified($type->getClassName()), 'class'); } if ($type instanceof UnionType) { foreach ($type->getTypes() as $unionedType) { if (! $unionedType instanceof TypeWithClassName) { throw new ShouldNotHappenException(); } $classConstTypes[] = new ClassConstFetch(new FullyQualified($unionedType->getClassName()), 'class'); } } return $classConstTypes; } }