diff --git a/src/EventHandler/Type/Optional/FunctionReturnTypeProvider.php b/src/EventHandler/Type/Optional/FunctionReturnTypeProvider.php index 2c0fbb3..896f434 100644 --- a/src/EventHandler/Type/Optional/FunctionReturnTypeProvider.php +++ b/src/EventHandler/Type/Optional/FunctionReturnTypeProvider.php @@ -28,9 +28,6 @@ final class FunctionReturnTypeProvider implements FunctionReturnTypeProviderInte return null; } - $clone = clone $argument_type; - $clone->possibly_undefined = true; - - return $clone; + return $argument_type->setPossiblyUndefined(true); } }