From b7e70f3cd797402ce0a7c56048f80a1f8bcf140f Mon Sep 17 00:00:00 2001 From: orklah Date: Tue, 9 Nov 2021 19:52:29 +0100 Subject: [PATCH] load the ReturnTypeWillChange stubs for all versions to allow using it on every PHP version --- stubs/CoreGenericClasses.phpstub | 7 ++++++ stubs/Php81.phpstub | 6 ----- tests/AttributeTest.php | 42 ++++++++++++++++++++++++++++++++ 3 files changed, 49 insertions(+), 6 deletions(-) diff --git a/stubs/CoreGenericClasses.phpstub b/stubs/CoreGenericClasses.phpstub index b39af3df93a..da4721e59c5 100644 --- a/stubs/CoreGenericClasses.phpstub +++ b/stubs/CoreGenericClasses.phpstub @@ -494,3 +494,10 @@ final class WeakMap implements ArrayAccess, Countable, IteratorAggregate, Traver */ public function offsetUnset($offset) {} } + + +#[Attribute] +final class ReturnTypeWillChange +{ + public function __construct() {} +} diff --git a/stubs/Php81.phpstub b/stubs/Php81.phpstub index a3525b3b27e..487b57b636f 100644 --- a/stubs/Php81.phpstub +++ b/stubs/Php81.phpstub @@ -4,12 +4,6 @@ namespace { /** @return non-empty-list */ public static function cases(): array; } - - #[Attribute] - final class ReturnTypeWillChange - { - public function __construct() {} - } } namespace FTP { diff --git a/tests/AttributeTest.php b/tests/AttributeTest.php index 1f02904b518..77ae6cefda3 100644 --- a/tests/AttributeTest.php +++ b/tests/AttributeTest.php @@ -180,6 +180,48 @@ class Bar implements FoobarInterface {} class Baz {} } ' + ], + 'returnTypeWillChange7.1' => [ + ' [ + '