getTypes(); foreach ($types as $type) { if (!$type instanceof \PHPStan\Type\NullType) { return $type; } } return $possibleUnionType; } }