From 2aa6c21bba1416f8611837845cb40ee0b5da03fe Mon Sep 17 00:00:00 2001 From: azjezz Date: Thu, 10 Nov 2022 19:57:54 +0100 Subject: [PATCH] Revert "fix: don't close argument type. (#7)" This reverts commit 1c425b71c6d9df6d5058c985d2128a9e2d3c0c09. --- .../Type/Optional/FunctionReturnTypeProvider.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/EventHandler/Type/Optional/FunctionReturnTypeProvider.php b/src/EventHandler/Type/Optional/FunctionReturnTypeProvider.php index 896f434..2c0fbb3 100644 --- a/src/EventHandler/Type/Optional/FunctionReturnTypeProvider.php +++ b/src/EventHandler/Type/Optional/FunctionReturnTypeProvider.php @@ -28,6 +28,9 @@ final class FunctionReturnTypeProvider implements FunctionReturnTypeProviderInte return null; } - return $argument_type->setPossiblyUndefined(true); + $clone = clone $argument_type; + $clone->possibly_undefined = true; + + return $clone; } }