From 9fa1da9262ceb06912363981629a03e8666e9bce Mon Sep 17 00:00:00 2001 From: Tomas Votruba Date: Sun, 30 Jun 2024 19:49:05 +0200 Subject: [PATCH] Add few union type fixtures to ReturnTypeFromStrictTypedCallRector (#6088) --- .../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 + { + } +} + +?>