From f5ca43aaab64a34db63b54df6573d2af7fefd93c Mon Sep 17 00:00:00 2001 From: Tomas Votruba Date: Sun, 30 Jun 2024 19:40:39 +0200 Subject: [PATCH] add few union type fixtures to ReturnTypeFromStrictTypedCallRector --- .../Fixture/skip_union_type_on_php74.php.inc | 23 +++++++++ .../FixturePhp80/merge_union_types.php.inc | 51 +++++++++++++++++++ 2 files changed, 74 insertions(+) create mode 100644 rules-tests/TypeDeclaration/Rector/ClassMethod/ReturnTypeFromStrictTypedCallRector/Fixture/skip_union_type_on_php74.php.inc create mode 100644 rules-tests/TypeDeclaration/Rector/ClassMethod/ReturnTypeFromStrictTypedCallRector/FixturePhp80/merge_union_types.php.inc diff --git a/rules-tests/TypeDeclaration/Rector/ClassMethod/ReturnTypeFromStrictTypedCallRector/Fixture/skip_union_type_on_php74.php.inc b/rules-tests/TypeDeclaration/Rector/ClassMethod/ReturnTypeFromStrictTypedCallRector/Fixture/skip_union_type_on_php74.php.inc new file mode 100644 index 00000000000..c743ebf08e6 --- /dev/null +++ b/rules-tests/TypeDeclaration/Rector/ClassMethod/ReturnTypeFromStrictTypedCallRector/Fixture/skip_union_type_on_php74.php.inc @@ -0,0 +1,23 @@ +getValue(); + } + + return $this->getNextValue(); + } + + private function getValue(): int|string + { + } + + private function getNextValue(): float|string + { + } +} diff --git a/rules-tests/TypeDeclaration/Rector/ClassMethod/ReturnTypeFromStrictTypedCallRector/FixturePhp80/merge_union_types.php.inc b/rules-tests/TypeDeclaration/Rector/ClassMethod/ReturnTypeFromStrictTypedCallRector/FixturePhp80/merge_union_types.php.inc new file mode 100644 index 00000000000..c214114062d --- /dev/null +++ b/rules-tests/TypeDeclaration/Rector/ClassMethod/ReturnTypeFromStrictTypedCallRector/FixturePhp80/merge_union_types.php.inc @@ -0,0 +1,51 @@ +getValue(); + } + + return $this->getNextValue(); + } + + private function getValue(): int|string + { + } + + private function getNextValue(): float|string + { + } +} + +?> +----- +getValue(); + } + + return $this->getNextValue(); + } + + private function getValue(): int|string + { + } + + private function getNextValue(): float|string + { + } +} + +?>