From b1555fb0cd7538ad06433f144a2f36febe5ef3fc Mon Sep 17 00:00:00 2001 From: Henrique Moody Date: Sun, 4 Feb 2024 19:23:04 +0100 Subject: [PATCH] Use a single line to describe return type Signed-off-by: Henrique Moody --- tests/unit/Rules/AlnumTest.php | 8 ++------ tests/unit/Rules/AlphaTest.php | 12 ++++-------- tests/unit/Rules/AlwaysInvalidTest.php | 2 +- tests/unit/Rules/AlwaysValidTest.php | 2 +- tests/unit/Rules/ArrayTypeTest.php | 12 ++++-------- tests/unit/Rules/ArrayValTest.php | 12 ++++-------- tests/unit/Rules/Base64Test.php | 12 ++++-------- tests/unit/Rules/BaseTest.php | 12 ++++-------- tests/unit/Rules/BetweenTest.php | 12 ++++-------- tests/unit/Rules/BoolTypeTest.php | 12 ++++-------- tests/unit/Rules/BoolValTest.php | 12 ++++-------- tests/unit/Rules/BsnTest.php | 12 ++++-------- tests/unit/Rules/CallTest.php | 8 ++++---- tests/unit/Rules/CallableTypeTest.php | 12 ++++-------- tests/unit/Rules/CallbackTest.php | 12 ++++-------- tests/unit/Rules/CharsetTest.php | 12 ++++-------- tests/unit/Rules/CnhTest.php | 12 ++++-------- tests/unit/Rules/CnpjTest.php | 12 ++++-------- tests/unit/Rules/ConsonantTest.php | 12 ++++-------- tests/unit/Rules/ContainsAnyTest.php | 12 ++++-------- tests/unit/Rules/ContainsTest.php | 12 ++++-------- tests/unit/Rules/ControlTest.php | 12 ++++-------- tests/unit/Rules/CountableTest.php | 12 ++++-------- tests/unit/Rules/CountryCodeTest.php | 12 ++++-------- tests/unit/Rules/CpfTest.php | 12 ++++-------- tests/unit/Rules/CreditCardTest.php | 12 ++++-------- tests/unit/Rules/CurrencyCodeTest.php | 12 ++++-------- tests/unit/Rules/DateTest.php | 12 ++++-------- tests/unit/Rules/DateTimeTest.php | 12 ++++-------- tests/unit/Rules/DecimalTest.php | 12 ++++-------- tests/unit/Rules/DigitTest.php | 12 ++++-------- tests/unit/Rules/DirectoryTest.php | 12 ++++-------- tests/unit/Rules/DomainTest.php | 12 ++++-------- tests/unit/Rules/EachTest.php | 12 ++++-------- tests/unit/Rules/EmailTest.php | 12 ++++-------- tests/unit/Rules/EndsWithTest.php | 12 ++++-------- tests/unit/Rules/EqualsTest.php | 12 ++++-------- tests/unit/Rules/EquivalentTest.php | 12 ++++-------- tests/unit/Rules/EvenTest.php | 12 ++++-------- tests/unit/Rules/ExecutableTest.php | 12 ++++-------- tests/unit/Rules/ExistsTest.php | 12 ++++-------- tests/unit/Rules/ExtensionTest.php | 12 ++++-------- tests/unit/Rules/FactorTest.php | 12 ++++-------- tests/unit/Rules/FalseValTest.php | 12 ++++-------- tests/unit/Rules/FibonacciTest.php | 12 ++++-------- tests/unit/Rules/FileTest.php | 12 ++++-------- tests/unit/Rules/FilterVarTest.php | 12 ++++-------- tests/unit/Rules/FiniteTest.php | 12 ++++-------- tests/unit/Rules/FloatTypeTest.php | 12 ++++-------- tests/unit/Rules/FloatValTest.php | 12 ++++-------- tests/unit/Rules/GraphTest.php | 12 ++++-------- tests/unit/Rules/GreaterThanTest.php | 12 ++++-------- tests/unit/Rules/HexRgbColorTest.php | 12 ++++-------- tests/unit/Rules/IbanTest.php | 12 ++++-------- tests/unit/Rules/IdenticalTest.php | 12 ++++-------- tests/unit/Rules/ImageTest.php | 12 ++++-------- tests/unit/Rules/ImeiTest.php | 12 ++++-------- tests/unit/Rules/InTest.php | 12 ++++-------- tests/unit/Rules/InfiniteTest.php | 12 ++++-------- tests/unit/Rules/InstanceTest.php | 12 ++++-------- tests/unit/Rules/IntTypeTest.php | 12 ++++-------- tests/unit/Rules/IntValTest.php | 12 ++++-------- tests/unit/Rules/IpTest.php | 12 ++++-------- tests/unit/Rules/IsbnTest.php | 12 ++++-------- tests/unit/Rules/IterableTypeTest.php | 12 ++++-------- tests/unit/Rules/JsonTest.php | 12 ++++-------- tests/unit/Rules/KeyValueTest.php | 12 ++++-------- tests/unit/Rules/LanguageCodeTest.php | 12 ++++-------- tests/unit/Rules/LeapDateTest.php | 12 ++++-------- tests/unit/Rules/LeapYearTest.php | 12 ++++-------- tests/unit/Rules/LengthTest.php | 12 ++++-------- tests/unit/Rules/LessThanTest.php | 12 ++++-------- tests/unit/Rules/LowercaseTest.php | 12 ++++-------- tests/unit/Rules/LuhnTest.php | 12 ++++-------- tests/unit/Rules/MacAddressTest.php | 12 ++++-------- tests/unit/Rules/MaxAgeTest.php | 12 ++++-------- tests/unit/Rules/MaxTest.php | 12 ++++-------- tests/unit/Rules/MimetypeTest.php | 12 ++++-------- tests/unit/Rules/MinAgeTest.php | 12 ++++-------- tests/unit/Rules/MinTest.php | 12 ++++-------- tests/unit/Rules/MultipleTest.php | 12 ++++-------- tests/unit/Rules/NegativeTest.php | 12 ++++-------- tests/unit/Rules/NfeAccessKeyTest.php | 12 ++++-------- tests/unit/Rules/NifTest.php | 12 ++++-------- tests/unit/Rules/NipTest.php | 12 ++++-------- tests/unit/Rules/NoTest.php | 12 ++++-------- tests/unit/Rules/NoWhitespaceTest.php | 12 ++++-------- tests/unit/Rules/NotBlankTest.php | 12 ++++-------- tests/unit/Rules/NotEmojiTest.php | 12 ++++-------- tests/unit/Rules/NotEmptyTest.php | 12 ++++-------- tests/unit/Rules/NotOptionalTest.php | 12 ++++-------- tests/unit/Rules/NullTypeTest.php | 12 ++++-------- tests/unit/Rules/NumberTest.php | 12 ++++-------- tests/unit/Rules/NumericValTest.php | 12 ++++-------- tests/unit/Rules/ObjectTypeTest.php | 12 ++++-------- tests/unit/Rules/OddTest.php | 12 ++++-------- tests/unit/Rules/PerfectSquareTest.php | 12 ++++-------- tests/unit/Rules/PeselTest.php | 12 ++++-------- tests/unit/Rules/PhoneTest.php | 12 ++++-------- tests/unit/Rules/PhpLabelTest.php | 12 ++++-------- tests/unit/Rules/PisTest.php | 12 ++++-------- tests/unit/Rules/PolishIdCardTest.php | 12 ++++-------- tests/unit/Rules/PortugueseNifTest.php | 12 ++++-------- tests/unit/Rules/PositiveTest.php | 12 ++++-------- tests/unit/Rules/PostalCodeTest.php | 12 ++++-------- tests/unit/Rules/PrimeNumberTest.php | 12 ++++-------- tests/unit/Rules/PrintableTest.php | 12 ++++-------- tests/unit/Rules/PropertyTest.php | 8 ++++---- tests/unit/Rules/PublicDomainSuffixTest.php | 12 ++++-------- tests/unit/Rules/PunctTest.php | 12 ++++-------- tests/unit/Rules/ReadableTest.php | 12 ++++-------- tests/unit/Rules/RegexTest.php | 12 ++++-------- tests/unit/Rules/ResourceTypeTest.php | 12 ++++-------- tests/unit/Rules/RomanTest.php | 12 ++++-------- tests/unit/Rules/ScalarValTest.php | 12 ++++-------- tests/unit/Rules/SizeTest.php | 12 ++++-------- tests/unit/Rules/SlugTest.php | 12 ++++-------- tests/unit/Rules/SortedTest.php | 12 ++++-------- tests/unit/Rules/SpaceTest.php | 12 ++++-------- tests/unit/Rules/StartsWithTest.php | 12 ++++-------- tests/unit/Rules/StringTypeTest.php | 12 ++++-------- tests/unit/Rules/StringValTest.php | 12 ++++-------- tests/unit/Rules/SubsetTest.php | 12 ++++-------- tests/unit/Rules/SymbolicLinkTest.php | 12 ++++-------- tests/unit/Rules/TimeTest.php | 12 ++++-------- tests/unit/Rules/TldTest.php | 12 ++++-------- tests/unit/Rules/TrueValTest.php | 12 ++++-------- tests/unit/Rules/TypeTest.php | 12 ++++-------- tests/unit/Rules/UniqueTest.php | 12 ++++-------- tests/unit/Rules/UploadedTest.php | 12 ++++-------- tests/unit/Rules/UppercaseTest.php | 12 ++++-------- tests/unit/Rules/UrlTest.php | 12 ++++-------- tests/unit/Rules/UuidTest.php | 12 ++++-------- tests/unit/Rules/VersionTest.php | 12 ++++-------- tests/unit/Rules/VideoUrlTest.php | 12 ++++-------- tests/unit/Rules/VowelTest.php | 12 ++++-------- tests/unit/Rules/WhenTest.php | 12 ++++-------- tests/unit/Rules/WritableTest.php | 12 ++++-------- tests/unit/Rules/XdigitTest.php | 12 ++++-------- tests/unit/Rules/YesTest.php | 12 ++++-------- 140 files changed, 552 insertions(+), 1096 deletions(-) diff --git a/tests/unit/Rules/AlnumTest.php b/tests/unit/Rules/AlnumTest.php index 9e90547dd..a3db6495e 100644 --- a/tests/unit/Rules/AlnumTest.php +++ b/tests/unit/Rules/AlnumTest.php @@ -19,9 +19,7 @@ #[CoversClass(Alnum::class)] final class AlnumTest extends RuleTestCase { - /** - * @return array - */ + /** @return iterable */ public static function providerForValidInput(): iterable { return [ @@ -42,9 +40,7 @@ public static function providerForValidInput(): iterable ]; } - /** - * @return array - */ + /** @return iterable */ public static function providerForInvalidInput(): iterable { return [ diff --git a/tests/unit/Rules/AlphaTest.php b/tests/unit/Rules/AlphaTest.php index cb37a7f40..2a4d720e2 100644 --- a/tests/unit/Rules/AlphaTest.php +++ b/tests/unit/Rules/AlphaTest.php @@ -19,10 +19,8 @@ #[CoversClass(Alpha::class)] final class AlphaTest extends RuleTestCase { - /** - * @return array - */ - public static function providerForValidInput(): array + /** @return iterable */ + public static function providerForValidInput(): iterable { return [ 'alphabetic' => [new Alpha(), 'alganet'], @@ -33,10 +31,8 @@ public static function providerForValidInput(): array ]; } - /** - * @return array - */ - public static function providerForInvalidInput(): array + /** @return iterable */ + public static function providerForInvalidInput(): iterable { return [ 'empty string' => [new Alpha(), ''], diff --git a/tests/unit/Rules/AlwaysInvalidTest.php b/tests/unit/Rules/AlwaysInvalidTest.php index 819b97b5e..0ec264bfc 100644 --- a/tests/unit/Rules/AlwaysInvalidTest.php +++ b/tests/unit/Rules/AlwaysInvalidTest.php @@ -31,7 +31,7 @@ public function itShouldAlwaysBeInvalid(mixed $input): void /** * @return mixed[][] */ - public static function providerForInvalidInput(): array + public static function providerForInvalidInput(): iterable { return [ [0], diff --git a/tests/unit/Rules/AlwaysValidTest.php b/tests/unit/Rules/AlwaysValidTest.php index da385fe75..73535334d 100644 --- a/tests/unit/Rules/AlwaysValidTest.php +++ b/tests/unit/Rules/AlwaysValidTest.php @@ -31,7 +31,7 @@ public function itAlwaysBeValid(mixed $input): void /** * @return mixed[][] */ - public static function providerForValidInput(): array + public static function providerForValidInput(): iterable { return [ [0], diff --git a/tests/unit/Rules/ArrayTypeTest.php b/tests/unit/Rules/ArrayTypeTest.php index 43c97667c..414394649 100644 --- a/tests/unit/Rules/ArrayTypeTest.php +++ b/tests/unit/Rules/ArrayTypeTest.php @@ -19,10 +19,8 @@ #[CoversClass(ArrayType::class)] final class ArrayTypeTest extends RuleTestCase { - /** - * @return array - */ - public static function providerForValidInput(): array + /** @return iterable */ + public static function providerForValidInput(): iterable { $rule = new ArrayType(); @@ -32,10 +30,8 @@ public static function providerForValidInput(): array ]; } - /** - * @return array - */ - public static function providerForInvalidInput(): array + /** @return iterable */ + public static function providerForInvalidInput(): iterable { $rule = new ArrayType(); diff --git a/tests/unit/Rules/ArrayValTest.php b/tests/unit/Rules/ArrayValTest.php index 34276cb47..fa65211f9 100644 --- a/tests/unit/Rules/ArrayValTest.php +++ b/tests/unit/Rules/ArrayValTest.php @@ -20,10 +20,8 @@ #[CoversClass(ArrayVal::class)] final class ArrayValTest extends RuleTestCase { - /** - * @return array - */ - public static function providerForValidInput(): array + /** @return iterable */ + public static function providerForValidInput(): iterable { $rule = new ArrayVal(); @@ -35,10 +33,8 @@ public static function providerForValidInput(): array ]; } - /** - * @return array - */ - public static function providerForInvalidInput(): array + /** @return iterable */ + public static function providerForInvalidInput(): iterable { $rule = new ArrayVal(); diff --git a/tests/unit/Rules/Base64Test.php b/tests/unit/Rules/Base64Test.php index 49823e405..362c6049a 100644 --- a/tests/unit/Rules/Base64Test.php +++ b/tests/unit/Rules/Base64Test.php @@ -19,10 +19,8 @@ #[CoversClass(Base64::class)] final class Base64Test extends RuleTestCase { - /** - * @return array - */ - public static function providerForValidInput(): array + /** @return iterable */ + public static function providerForValidInput(): iterable { $rule = new Base64(); @@ -51,10 +49,8 @@ public static function providerForValidInput(): array ]; } - /** - * @return array - */ - public static function providerForInvalidInput(): array + /** @return iterable */ + public static function providerForInvalidInput(): iterable { $rule = new Base64(); diff --git a/tests/unit/Rules/BaseTest.php b/tests/unit/Rules/BaseTest.php index 1af5c121f..d8c744f58 100644 --- a/tests/unit/Rules/BaseTest.php +++ b/tests/unit/Rules/BaseTest.php @@ -17,10 +17,8 @@ #[CoversClass(Base::class)] final class BaseTest extends RuleTestCase { - /** - * @return array - */ - public static function providerForValidInput(): array + /** @return iterable */ + public static function providerForValidInput(): iterable { return [ [new Base(2), '011010001'], @@ -35,10 +33,8 @@ public static function providerForValidInput(): array ]; } - /** - * @return array - */ - public static function providerForInvalidInput(): array + /** @return iterable */ + public static function providerForInvalidInput(): iterable { return [ [new Base(2), ''], diff --git a/tests/unit/Rules/BetweenTest.php b/tests/unit/Rules/BetweenTest.php index 45c61b31f..a5099a0d3 100644 --- a/tests/unit/Rules/BetweenTest.php +++ b/tests/unit/Rules/BetweenTest.php @@ -38,10 +38,8 @@ public function minimumValueShouldNotBeEqualsToMaximumValue(): void new Between(5, 5); } - /** - * @return array - */ - public static function providerForValidInput(): array + /** @return iterable */ + public static function providerForValidInput(): iterable { return [ [new Between(0, 1), 1], @@ -56,10 +54,8 @@ public static function providerForValidInput(): array ]; } - /** - * @return array - */ - public static function providerForInvalidInput(): array + /** @return iterable */ + public static function providerForInvalidInput(): iterable { return [ [new Between(10, 20), ''], diff --git a/tests/unit/Rules/BoolTypeTest.php b/tests/unit/Rules/BoolTypeTest.php index 7a42911bf..51a723b7f 100644 --- a/tests/unit/Rules/BoolTypeTest.php +++ b/tests/unit/Rules/BoolTypeTest.php @@ -18,10 +18,8 @@ #[CoversClass(BoolType::class)] final class BoolTypeTest extends RuleTestCase { - /** - * @return array - */ - public static function providerForValidInput(): array + /** @return iterable */ + public static function providerForValidInput(): iterable { $rule = new BoolType(); @@ -31,10 +29,8 @@ public static function providerForValidInput(): array ]; } - /** - * @return array - */ - public static function providerForInvalidInput(): array + /** @return iterable */ + public static function providerForInvalidInput(): iterable { $rule = new BoolType(); diff --git a/tests/unit/Rules/BoolValTest.php b/tests/unit/Rules/BoolValTest.php index 195fd7650..3e6a7a3be 100644 --- a/tests/unit/Rules/BoolValTest.php +++ b/tests/unit/Rules/BoolValTest.php @@ -17,10 +17,8 @@ #[CoversClass(BoolVal::class)] final class BoolValTest extends RuleTestCase { - /** - * @return array - */ - public static function providerForValidInput(): array + /** @return iterable */ + public static function providerForValidInput(): iterable { $rule = new BoolVal(); @@ -37,10 +35,8 @@ public static function providerForValidInput(): array ]; } - /** - * @return array - */ - public static function providerForInvalidInput(): array + /** @return iterable */ + public static function providerForInvalidInput(): iterable { $rule = new BoolVal(); diff --git a/tests/unit/Rules/BsnTest.php b/tests/unit/Rules/BsnTest.php index 2151055c0..4dfbd066b 100644 --- a/tests/unit/Rules/BsnTest.php +++ b/tests/unit/Rules/BsnTest.php @@ -17,10 +17,8 @@ #[CoversClass(Bsn::class)] final class BsnTest extends RuleTestCase { - /** - * @return array - */ - public static function providerForValidInput(): array + /** @return iterable */ + public static function providerForValidInput(): iterable { $rule = new Bsn(); @@ -38,10 +36,8 @@ public static function providerForValidInput(): array ]; } - /** - * @return array - */ - public static function providerForInvalidInput(): array + /** @return iterable */ + public static function providerForInvalidInput(): iterable { $rule = new Bsn(); diff --git a/tests/unit/Rules/CallTest.php b/tests/unit/Rules/CallTest.php index 9fe6837cb..34436f9d1 100644 --- a/tests/unit/Rules/CallTest.php +++ b/tests/unit/Rules/CallTest.php @@ -90,16 +90,16 @@ public function itShouldRestorePreviousPhpErrorHandler(): void trigger_error('Forcing PHP to trigger an error'); } - /** @return array */ - public static function providerForValidInput(): array + /** @return iterable */ + public static function providerForValidInput(): iterable { return [ 'valid rule and valid callable' => [new Call('trim', Stub::pass(1)), ' input '], ]; } - /** @return array */ - public static function providerForInvalidInput(): array + /** @return iterable */ + public static function providerForInvalidInput(): iterable { return [ 'PHP error' => [new Call('trim', Stub::pass(1)), []], diff --git a/tests/unit/Rules/CallableTypeTest.php b/tests/unit/Rules/CallableTypeTest.php index 65d79e402..7cccf8ef9 100644 --- a/tests/unit/Rules/CallableTypeTest.php +++ b/tests/unit/Rules/CallableTypeTest.php @@ -21,10 +21,8 @@ #[CoversClass(CallableType::class)] final class CallableTypeTest extends RuleTestCase { - /** - * @return array - */ - public static function providerForValidInput(): array + /** @return iterable */ + public static function providerForValidInput(): iterable { $rule = new CallableType(); @@ -36,10 +34,8 @@ public static function providerForValidInput(): array ]; } - /** - * @return array - */ - public static function providerForInvalidInput(): array + /** @return iterable */ + public static function providerForInvalidInput(): iterable { $rule = new CallableType(); diff --git a/tests/unit/Rules/CallbackTest.php b/tests/unit/Rules/CallbackTest.php index 8569f7664..c0032ac3f 100644 --- a/tests/unit/Rules/CallbackTest.php +++ b/tests/unit/Rules/CallbackTest.php @@ -19,10 +19,8 @@ #[CoversClass(Callback::class)] final class CallbackTest extends RuleTestCase { - /** - * @return array - */ - public static function providerForValidInput(): array + /** @return iterable */ + public static function providerForValidInput(): iterable { return [ [new Callback('is_a', 'stdClass'), new stdClass()], @@ -37,10 +35,8 @@ public static function providerForValidInput(): array ]; } - /** - * @return array - */ - public static function providerForInvalidInput(): array + /** @return iterable */ + public static function providerForInvalidInput(): iterable { return [ [ diff --git a/tests/unit/Rules/CharsetTest.php b/tests/unit/Rules/CharsetTest.php index a9b8aed9e..934a58181 100644 --- a/tests/unit/Rules/CharsetTest.php +++ b/tests/unit/Rules/CharsetTest.php @@ -30,10 +30,8 @@ public function itShouldThrowsExceptionWhenCharsetIsNotValid(): void new Charset('UTF-8', 'UTF-9'); } - /** - * @return array - */ - public static function providerForValidInput(): array + /** @return iterable */ + public static function providerForValidInput(): iterable { return [ [new Charset('UTF-8'), ''], @@ -47,10 +45,8 @@ public static function providerForValidInput(): array ]; } - /** - * @return array - */ - public static function providerForInvalidInput(): array + /** @return iterable */ + public static function providerForInvalidInput(): iterable { $rule = new Charset('ASCII'); diff --git a/tests/unit/Rules/CnhTest.php b/tests/unit/Rules/CnhTest.php index f0e1ee5ea..9dbffff32 100644 --- a/tests/unit/Rules/CnhTest.php +++ b/tests/unit/Rules/CnhTest.php @@ -18,10 +18,8 @@ #[CoversClass(Cnh::class)] final class CnhTest extends RuleTestCase { - /** - * @return array - */ - public static function providerForValidInput(): array + /** @return iterable */ + public static function providerForValidInput(): iterable { $rule = new Cnh(); @@ -53,10 +51,8 @@ public static function providerForValidInput(): array ]; } - /** - * @return array - */ - public static function providerForInvalidInput(): array + /** @return iterable */ + public static function providerForInvalidInput(): iterable { $rule = new Cnh(); diff --git a/tests/unit/Rules/CnpjTest.php b/tests/unit/Rules/CnpjTest.php index 7b9f668e3..1deed4bb8 100644 --- a/tests/unit/Rules/CnpjTest.php +++ b/tests/unit/Rules/CnpjTest.php @@ -17,10 +17,8 @@ #[CoversClass(Cnpj::class)] final class CnpjTest extends RuleTestCase { - /** - * @return array - */ - public static function providerForValidInput(): array + /** @return iterable */ + public static function providerForValidInput(): iterable { $rule = new Cnpj(); @@ -39,10 +37,8 @@ public static function providerForValidInput(): array ]; } - /** - * @return array - */ - public static function providerForInvalidInput(): array + /** @return iterable */ + public static function providerForInvalidInput(): iterable { $rule = new Cnpj(); diff --git a/tests/unit/Rules/ConsonantTest.php b/tests/unit/Rules/ConsonantTest.php index d95f66a4b..0daa6d096 100644 --- a/tests/unit/Rules/ConsonantTest.php +++ b/tests/unit/Rules/ConsonantTest.php @@ -19,10 +19,8 @@ #[CoversClass(Consonant::class)] final class ConsonantTest extends RuleTestCase { - /** - * @return array - */ - public static function providerForValidInput(): array + /** @return iterable */ + public static function providerForValidInput(): iterable { $consonant = new Consonant(); @@ -44,10 +42,8 @@ public static function providerForValidInput(): array ]; } - /** - * @return array - */ - public static function providerForInvalidInput(): array + /** @return iterable */ + public static function providerForInvalidInput(): iterable { $consonant = new Consonant(); diff --git a/tests/unit/Rules/ContainsAnyTest.php b/tests/unit/Rules/ContainsAnyTest.php index 4915a1c62..27e3685b8 100644 --- a/tests/unit/Rules/ContainsAnyTest.php +++ b/tests/unit/Rules/ContainsAnyTest.php @@ -17,10 +17,8 @@ #[CoversClass(ContainsAny::class)] final class ContainsAnyTest extends RuleTestCase { - /** - * @return array - */ - public static function providerForValidInput(): array + /** @return iterable */ + public static function providerForValidInput(): iterable { return [ [new ContainsAny(['Something', 'Else']), 'something else'], @@ -35,10 +33,8 @@ public static function providerForValidInput(): array ]; } - /** - * @return array - */ - public static function providerForInvalidInput(): array + /** @return iterable */ + public static function providerForInvalidInput(): iterable { return [ [new ContainsAny(['foo']), ['bar', 'baz']], diff --git a/tests/unit/Rules/ContainsTest.php b/tests/unit/Rules/ContainsTest.php index 8f21b5a75..591e06ce3 100644 --- a/tests/unit/Rules/ContainsTest.php +++ b/tests/unit/Rules/ContainsTest.php @@ -17,10 +17,8 @@ #[CoversClass(Contains::class)] final class ContainsTest extends RuleTestCase { - /** - * @return array - */ - public static function providerForValidInput(): array + /** @return iterable */ + public static function providerForValidInput(): iterable { return [ [new Contains('foo', false), ['bar', 'foo']], @@ -38,10 +36,8 @@ public static function providerForValidInput(): array ]; } - /** - * @return array - */ - public static function providerForInvalidInput(): array + /** @return iterable */ + public static function providerForInvalidInput(): iterable { return [ [new Contains('foo', false), ''], diff --git a/tests/unit/Rules/ControlTest.php b/tests/unit/Rules/ControlTest.php index da4969be9..ca08eeed2 100644 --- a/tests/unit/Rules/ControlTest.php +++ b/tests/unit/Rules/ControlTest.php @@ -19,10 +19,8 @@ #[CoversClass(Control::class)] final class ControlTest extends RuleTestCase { - /** - * @return array - */ - public static function providerForValidInput(): array + /** @return iterable */ + public static function providerForValidInput(): iterable { $sut = new Control(); @@ -36,10 +34,8 @@ public static function providerForValidInput(): array ]; } - /** - * @return array - */ - public static function providerForInvalidInput(): array + /** @return iterable */ + public static function providerForInvalidInput(): iterable { $sut = new Control(); diff --git a/tests/unit/Rules/CountableTest.php b/tests/unit/Rules/CountableTest.php index 6276274ed..f98ddf534 100644 --- a/tests/unit/Rules/CountableTest.php +++ b/tests/unit/Rules/CountableTest.php @@ -22,10 +22,8 @@ #[CoversClass(Countable::class)] final class CountableTest extends RuleTestCase { - /** - * @return array - */ - public static function providerForValidInput(): array + /** @return iterable */ + public static function providerForValidInput(): iterable { $rule = new Countable(); @@ -36,10 +34,8 @@ public static function providerForValidInput(): array ]; } - /** - * @return array - */ - public static function providerForInvalidInput(): array + /** @return iterable */ + public static function providerForInvalidInput(): iterable { $rule = new Countable(); diff --git a/tests/unit/Rules/CountryCodeTest.php b/tests/unit/Rules/CountryCodeTest.php index aaa6d2fd5..f88e02ac1 100644 --- a/tests/unit/Rules/CountryCodeTest.php +++ b/tests/unit/Rules/CountryCodeTest.php @@ -30,10 +30,8 @@ public function itShouldThrowsExceptionWhenInvalidFormat(): void new CountryCode('whatever'); } - /** - * @return array - */ - public static function providerForValidInput(): array + /** @return iterable */ + public static function providerForValidInput(): iterable { return [ [new CountryCode(CountryCode::ALPHA2), 'BR'], @@ -48,10 +46,8 @@ public static function providerForValidInput(): array ]; } - /** - * @return array - */ - public static function providerForInvalidInput(): array + /** @return iterable */ + public static function providerForInvalidInput(): iterable { return [ [new CountryCode(), 'ca'], diff --git a/tests/unit/Rules/CpfTest.php b/tests/unit/Rules/CpfTest.php index 342f5eeb6..a680b5b95 100644 --- a/tests/unit/Rules/CpfTest.php +++ b/tests/unit/Rules/CpfTest.php @@ -17,10 +17,8 @@ #[CoversClass(Cpf::class)] final class CpfTest extends RuleTestCase { - /** - * @return array - */ - public static function providerForValidInput(): array + /** @return iterable */ + public static function providerForValidInput(): iterable { $rule = new Cpf(); @@ -38,10 +36,8 @@ public static function providerForValidInput(): array ]; } - /** - * @return array - */ - public static function providerForInvalidInput(): array + /** @return iterable */ + public static function providerForInvalidInput(): iterable { $rule = new Cpf(); diff --git a/tests/unit/Rules/CreditCardTest.php b/tests/unit/Rules/CreditCardTest.php index 5440cf10d..4961ff53e 100644 --- a/tests/unit/Rules/CreditCardTest.php +++ b/tests/unit/Rules/CreditCardTest.php @@ -31,10 +31,8 @@ public function itShouldThrowExceptionWhenCreditCardBrandIsNotValid(): void new CreditCard('RespectCard'); } - /** - * @return array - */ - public static function providerForValidInput(): array + /** @return iterable */ + public static function providerForValidInput(): iterable { $general = new CreditCard(); $amex = new CreditCard(CreditCard::AMERICAN_EXPRESS); @@ -68,10 +66,8 @@ public static function providerForValidInput(): array ]; } - /** - * @return array - */ - public static function providerForInvalidInput(): array + /** @return iterable */ + public static function providerForInvalidInput(): iterable { $general = new CreditCard(); $amex = new CreditCard(CreditCard::AMERICAN_EXPRESS); diff --git a/tests/unit/Rules/CurrencyCodeTest.php b/tests/unit/Rules/CurrencyCodeTest.php index 38fcdef32..d6f3be863 100644 --- a/tests/unit/Rules/CurrencyCodeTest.php +++ b/tests/unit/Rules/CurrencyCodeTest.php @@ -17,10 +17,8 @@ #[CoversClass(CurrencyCode::class)] final class CurrencyCodeTest extends RuleTestCase { - /** - * @return array - */ - public static function providerForValidInput(): array + /** @return iterable */ + public static function providerForValidInput(): iterable { $rule = new CurrencyCode(); @@ -33,10 +31,8 @@ public static function providerForValidInput(): array ]; } - /** - * @return array - */ - public static function providerForInvalidInput(): array + /** @return iterable */ + public static function providerForInvalidInput(): iterable { $rule = new CurrencyCode(); diff --git a/tests/unit/Rules/DateTest.php b/tests/unit/Rules/DateTest.php index f009b11c6..d31203b1b 100644 --- a/tests/unit/Rules/DateTest.php +++ b/tests/unit/Rules/DateTest.php @@ -42,10 +42,8 @@ public static function validFormatsProvider(): array ]; } - /** - * @return array - */ - public static function providerForValidInput(): array + /** @return iterable */ + public static function providerForValidInput(): iterable { return [ [new Date(), '2017-12-31'], @@ -56,10 +54,8 @@ public static function providerForValidInput(): array ]; } - /** - * @return array - */ - public static function providerForInvalidInput(): array + /** @return iterable */ + public static function providerForInvalidInput(): iterable { return [ [new Date(), 'not-a-date'], diff --git a/tests/unit/Rules/DateTimeTest.php b/tests/unit/Rules/DateTimeTest.php index b8fdc8bfa..59b5d997a 100644 --- a/tests/unit/Rules/DateTimeTest.php +++ b/tests/unit/Rules/DateTimeTest.php @@ -57,10 +57,8 @@ public static function providerForDateTimeWithTimezone(): array ]; } - /** - * @return array - */ - public static function providerForValidInput(): array + /** @return iterable */ + public static function providerForValidInput(): iterable { return [ [new DateTime(), 'now'], @@ -85,10 +83,8 @@ public static function providerForValidInput(): array ]; } - /** - * @return array - */ - public static function providerForInvalidInput(): array + /** @return iterable */ + public static function providerForInvalidInput(): iterable { return [ [new DateTime(), 'not-a-date'], diff --git a/tests/unit/Rules/DecimalTest.php b/tests/unit/Rules/DecimalTest.php index aa8a1df79..4bad1a94f 100644 --- a/tests/unit/Rules/DecimalTest.php +++ b/tests/unit/Rules/DecimalTest.php @@ -23,10 +23,8 @@ #[CoversClass(Decimal::class)] final class DecimalTest extends RuleTestCase { - /** - * @return array - */ - public static function providerForValidInput(): array + /** @return iterable */ + public static function providerForValidInput(): iterable { return [ [new Decimal(0), 1], @@ -48,10 +46,8 @@ public static function providerForValidInput(): array ]; } - /** - * @return array - */ - public static function providerForInvalidInput(): array + /** @return iterable */ + public static function providerForInvalidInput(): iterable { return [ [new Decimal(1), '1.50'], diff --git a/tests/unit/Rules/DigitTest.php b/tests/unit/Rules/DigitTest.php index 9604547b8..fa07d69c4 100644 --- a/tests/unit/Rules/DigitTest.php +++ b/tests/unit/Rules/DigitTest.php @@ -18,10 +18,8 @@ #[CoversClass(Digit::class)] final class DigitTest extends RuleTestCase { - /** - * @return array - */ - public static function providerForValidInput(): array + /** @return iterable */ + public static function providerForValidInput(): iterable { return [ 'positive integer' => [new Digit(), 165], @@ -37,10 +35,8 @@ public static function providerForValidInput(): array ]; } - /** - * @return array - */ - public static function providerForInvalidInput(): array + /** @return iterable */ + public static function providerForInvalidInput(): iterable { return [ 'empty' => [new Digit(), ''], diff --git a/tests/unit/Rules/DirectoryTest.php b/tests/unit/Rules/DirectoryTest.php index 1ecfe0a77..ace4862b3 100644 --- a/tests/unit/Rules/DirectoryTest.php +++ b/tests/unit/Rules/DirectoryTest.php @@ -22,10 +22,8 @@ #[CoversClass(Directory::class)] final class DirectoryTest extends RuleTestCase { - /** - * @return array - */ - public static function providerForValidInput(): array + /** @return iterable */ + public static function providerForValidInput(): iterable { $rule = new Directory(); @@ -36,10 +34,8 @@ public static function providerForValidInput(): array ]; } - /** - * @return array - */ - public static function providerForInvalidInput(): array + /** @return iterable */ + public static function providerForInvalidInput(): iterable { $rule = new Directory(); diff --git a/tests/unit/Rules/DomainTest.php b/tests/unit/Rules/DomainTest.php index d191ea108..4e5ad8ff0 100644 --- a/tests/unit/Rules/DomainTest.php +++ b/tests/unit/Rules/DomainTest.php @@ -19,10 +19,8 @@ #[CoversClass(Domain::class)] final class DomainTest extends RuleTestCase { - /** - * @return array - */ - public static function providerForValidInput(): array + /** @return iterable */ + public static function providerForValidInput(): iterable { return [ [new Domain(false), '111111111111domain.local'], @@ -37,10 +35,8 @@ public static function providerForValidInput(): array ]; } - /** - * @return array - */ - public static function providerForInvalidInput(): array + /** @return iterable */ + public static function providerForInvalidInput(): iterable { return [ [new Domain(), null], diff --git a/tests/unit/Rules/EachTest.php b/tests/unit/Rules/EachTest.php index f4dd12af0..c17285536 100644 --- a/tests/unit/Rules/EachTest.php +++ b/tests/unit/Rules/EachTest.php @@ -70,10 +70,8 @@ public function itShouldNotOverrideMessages(): void } } - /** - * @return array - */ - public static function providerForValidInput(): array + /** @return iterable */ + public static function providerForValidInput(): iterable { return [ [new Each(Stub::pass(0)), []], @@ -83,10 +81,8 @@ public static function providerForValidInput(): array ]; } - /** - * @return array - */ - public static function providerForInvalidInput(): array + /** @return iterable */ + public static function providerForInvalidInput(): iterable { return [ [new Each(Stub::fail(0)), 123], diff --git a/tests/unit/Rules/EmailTest.php b/tests/unit/Rules/EmailTest.php index df517aebd..fa745cd21 100644 --- a/tests/unit/Rules/EmailTest.php +++ b/tests/unit/Rules/EmailTest.php @@ -42,10 +42,8 @@ public function shouldUseEmailValidatorToValidate(): void self::assertTrue($sut->validate($input)); } - /** - * @return array - */ - public static function providerForValidInput(): array + /** @return iterable */ + public static function providerForValidInput(): iterable { $sut = new Email(null); @@ -57,10 +55,8 @@ public static function providerForValidInput(): array ]; } - /** - * @return array - */ - public static function providerForInvalidInput(): array + /** @return iterable */ + public static function providerForInvalidInput(): iterable { $sut = new Email(null); diff --git a/tests/unit/Rules/EndsWithTest.php b/tests/unit/Rules/EndsWithTest.php index aaeb078a9..44f34b64e 100644 --- a/tests/unit/Rules/EndsWithTest.php +++ b/tests/unit/Rules/EndsWithTest.php @@ -17,10 +17,8 @@ #[CoversClass(EndsWith::class)] final class EndsWithTest extends RuleTestCase { - /** - * @return array - */ - public static function providerForValidInput(): array + /** @return iterable */ + public static function providerForValidInput(): iterable { return [ [new EndsWith('foo'), ['bar', 'foo']], @@ -33,10 +31,8 @@ public static function providerForValidInput(): array ]; } - /** - * @return array - */ - public static function providerForInvalidInput(): array + /** @return iterable */ + public static function providerForInvalidInput(): iterable { return [ [new EndsWith('foo'), ''], diff --git a/tests/unit/Rules/EqualsTest.php b/tests/unit/Rules/EqualsTest.php index a0ee6cd00..3545d2e48 100644 --- a/tests/unit/Rules/EqualsTest.php +++ b/tests/unit/Rules/EqualsTest.php @@ -29,10 +29,8 @@ public function shouldPassCompareToParameterToException(): void self::assertSame($compareTo, $exception->getParam('compareTo')); } - /** - * @return array - */ - public static function providerForValidInput(): array + /** @return iterable */ + public static function providerForValidInput(): iterable { return [ [new Equals('foo'), 'foo'], @@ -43,10 +41,8 @@ public static function providerForValidInput(): array ]; } - /** - * @return array - */ - public static function providerForInvalidInput(): array + /** @return iterable */ + public static function providerForInvalidInput(): iterable { return [ [new Equals('foo'), ''], diff --git a/tests/unit/Rules/EquivalentTest.php b/tests/unit/Rules/EquivalentTest.php index cbf4faa58..16564b45c 100644 --- a/tests/unit/Rules/EquivalentTest.php +++ b/tests/unit/Rules/EquivalentTest.php @@ -18,10 +18,8 @@ #[CoversClass(Equivalent::class)] final class EquivalentTest extends RuleTestCase { - /** - * @return array - */ - public static function providerForValidInput(): array + /** @return iterable */ + public static function providerForValidInput(): iterable { return [ [new Equivalent(1), true], @@ -32,10 +30,8 @@ public static function providerForValidInput(): array ]; } - /** - * @return array - */ - public static function providerForInvalidInput(): array + /** @return iterable */ + public static function providerForInvalidInput(): iterable { return [ [new Equivalent(1), false], diff --git a/tests/unit/Rules/EvenTest.php b/tests/unit/Rules/EvenTest.php index 83d0c705a..ae6b5d5a8 100644 --- a/tests/unit/Rules/EvenTest.php +++ b/tests/unit/Rules/EvenTest.php @@ -19,10 +19,8 @@ #[CoversClass(Even::class)] final class EvenTest extends RuleTestCase { - /** - * @return array - */ - public static function providerForValidInput(): array + /** @return iterable */ + public static function providerForValidInput(): iterable { return [ [new Even(), 2], @@ -32,10 +30,8 @@ public static function providerForValidInput(): array ]; } - /** - * @return array - */ - public static function providerForInvalidInput(): array + /** @return iterable */ + public static function providerForInvalidInput(): iterable { return [ [new Even(), ''], diff --git a/tests/unit/Rules/ExecutableTest.php b/tests/unit/Rules/ExecutableTest.php index 97e0e847a..a19db036e 100644 --- a/tests/unit/Rules/ExecutableTest.php +++ b/tests/unit/Rules/ExecutableTest.php @@ -19,10 +19,8 @@ #[CoversClass(Executable::class)] final class ExecutableTest extends RuleTestCase { - /** - * @return array - */ - public static function providerForValidInput(): array + /** @return iterable */ + public static function providerForValidInput(): iterable { $rule = new Executable(); @@ -33,10 +31,8 @@ public static function providerForValidInput(): array ]; } - /** - * @return array - */ - public static function providerForInvalidInput(): array + /** @return iterable */ + public static function providerForInvalidInput(): iterable { $rule = new Executable(); diff --git a/tests/unit/Rules/ExistsTest.php b/tests/unit/Rules/ExistsTest.php index 8083a0e13..ee607c4a6 100644 --- a/tests/unit/Rules/ExistsTest.php +++ b/tests/unit/Rules/ExistsTest.php @@ -19,10 +19,8 @@ #[CoversClass(Exists::class)] final class ExistsTest extends RuleTestCase { - /** - * @return array - */ - public static function providerForValidInput(): array + /** @return iterable */ + public static function providerForValidInput(): iterable { $rule = new Exists(); @@ -33,10 +31,8 @@ public static function providerForValidInput(): array ]; } - /** - * @return array - */ - public static function providerForInvalidInput(): array + /** @return iterable */ + public static function providerForInvalidInput(): iterable { $rule = new Exists(); diff --git a/tests/unit/Rules/ExtensionTest.php b/tests/unit/Rules/ExtensionTest.php index adb802de9..fe0399a47 100644 --- a/tests/unit/Rules/ExtensionTest.php +++ b/tests/unit/Rules/ExtensionTest.php @@ -18,10 +18,8 @@ #[CoversClass(Extension::class)] final class ExtensionTest extends RuleTestCase { - /** - * @return array - */ - public static function providerForValidInput(): array + /** @return iterable */ + public static function providerForValidInput(): iterable { return [ 'txt' => [new Extension('txt'), 'filename.txt'], @@ -35,10 +33,8 @@ public static function providerForValidInput(): array ]; } - /** - * @return array - */ - public static function providerForInvalidInput(): array + /** @return iterable */ + public static function providerForInvalidInput(): iterable { return [ 'jpg' => [new Extension('jpg'), 'filename.txt'], diff --git a/tests/unit/Rules/FactorTest.php b/tests/unit/Rules/FactorTest.php index e53ccb5be..2ac39e358 100644 --- a/tests/unit/Rules/FactorTest.php +++ b/tests/unit/Rules/FactorTest.php @@ -25,10 +25,8 @@ #[CoversClass(Factor::class)] final class FactorTest extends RuleTestCase { - /** - * @return array - */ - public static function providerForValidInput(): array + /** @return iterable */ + public static function providerForValidInput(): iterable { return [ '1 is factor 1' => [new Factor(1), 1], @@ -60,10 +58,8 @@ public static function providerForValidInput(): array ]; } - /** - * @return array - */ - public static function providerForInvalidInput(): array + /** @return iterable */ + public static function providerForInvalidInput(): iterable { return [ '3 is not factor 2' => [new Factor(3), 2], diff --git a/tests/unit/Rules/FalseValTest.php b/tests/unit/Rules/FalseValTest.php index c7d6ef2ff..cd56ba619 100644 --- a/tests/unit/Rules/FalseValTest.php +++ b/tests/unit/Rules/FalseValTest.php @@ -22,10 +22,8 @@ #[CoversClass(FalseVal::class)] final class FalseValTest extends RuleTestCase { - /** - * @return array - */ - public static function providerForValidInput(): array + /** @return iterable */ + public static function providerForValidInput(): iterable { $sut = new FalseVal(); @@ -46,10 +44,8 @@ public static function providerForValidInput(): array ]; } - /** - * @return array - */ - public static function providerForInvalidInput(): array + /** @return iterable */ + public static function providerForInvalidInput(): iterable { $sut = new FalseVal(); diff --git a/tests/unit/Rules/FibonacciTest.php b/tests/unit/Rules/FibonacciTest.php index 74da0b6f4..e2bf3d9a7 100644 --- a/tests/unit/Rules/FibonacciTest.php +++ b/tests/unit/Rules/FibonacciTest.php @@ -17,10 +17,8 @@ #[CoversClass(Fibonacci::class)] final class FibonacciTest extends RuleTestCase { - /** - * @return array - */ - public static function providerForValidInput(): array + /** @return iterable */ + public static function providerForValidInput(): iterable { $rule = new Fibonacci(); @@ -41,10 +39,8 @@ public static function providerForValidInput(): array ]; } - /** - * @return array - */ - public static function providerForInvalidInput(): array + /** @return iterable */ + public static function providerForInvalidInput(): iterable { $rule = new Fibonacci(); diff --git a/tests/unit/Rules/FileTest.php b/tests/unit/Rules/FileTest.php index e6f001e5f..fc66cdf53 100644 --- a/tests/unit/Rules/FileTest.php +++ b/tests/unit/Rules/FileTest.php @@ -22,10 +22,8 @@ #[CoversClass(File::class)] final class FileTest extends RuleTestCase { - /** - * @return array - */ - public static function providerForValidInput(): array + /** @return iterable */ + public static function providerForValidInput(): iterable { $sut = new File(); @@ -36,10 +34,8 @@ public static function providerForValidInput(): array ]; } - /** - * @return array - */ - public static function providerForInvalidInput(): array + /** @return iterable */ + public static function providerForInvalidInput(): iterable { $sut = new File(); diff --git a/tests/unit/Rules/FilterVarTest.php b/tests/unit/Rules/FilterVarTest.php index aed9564ca..f7fb5711a 100644 --- a/tests/unit/Rules/FilterVarTest.php +++ b/tests/unit/Rules/FilterVarTest.php @@ -39,10 +39,8 @@ public function itShouldThrowsExceptionWhenFilterIsNotValid(): void new FilterVar(FILTER_SANITIZE_EMAIL); } - /** - * @return array - */ - public static function providerForValidInput(): array + /** @return iterable */ + public static function providerForValidInput(): iterable { return [ [new FilterVar(FILTER_VALIDATE_INT), '12345'], @@ -55,10 +53,8 @@ public static function providerForValidInput(): array ]; } - /** - * @return array - */ - public static function providerForInvalidInput(): array + /** @return iterable */ + public static function providerForInvalidInput(): iterable { return [ [new FilterVar(FILTER_VALIDATE_INT), 1.4], diff --git a/tests/unit/Rules/FiniteTest.php b/tests/unit/Rules/FiniteTest.php index c37287b6e..c474fc730 100644 --- a/tests/unit/Rules/FiniteTest.php +++ b/tests/unit/Rules/FiniteTest.php @@ -23,10 +23,8 @@ #[CoversClass(Finite::class)] final class FiniteTest extends RuleTestCase { - /** - * @return array - */ - public static function providerForValidInput(): array + /** @return iterable */ + public static function providerForValidInput(): iterable { $sut = new Finite(); @@ -41,10 +39,8 @@ public static function providerForValidInput(): array ]; } - /** - * @return array - */ - public static function providerForInvalidInput(): array + /** @return iterable */ + public static function providerForInvalidInput(): iterable { $sut = new Finite(); diff --git a/tests/unit/Rules/FloatTypeTest.php b/tests/unit/Rules/FloatTypeTest.php index dc702bca2..99945a565 100644 --- a/tests/unit/Rules/FloatTypeTest.php +++ b/tests/unit/Rules/FloatTypeTest.php @@ -19,10 +19,8 @@ #[CoversClass(FloatType::class)] final class FloatTypeTest extends RuleTestCase { - /** - * @return array - */ - public static function providerForValidInput(): array + /** @return iterable */ + public static function providerForValidInput(): iterable { $rule = new FloatType(); @@ -37,10 +35,8 @@ public static function providerForValidInput(): array ]; } - /** - * @return array - */ - public static function providerForInvalidInput(): array + /** @return iterable */ + public static function providerForInvalidInput(): iterable { $rule = new FloatType(); diff --git a/tests/unit/Rules/FloatValTest.php b/tests/unit/Rules/FloatValTest.php index 7a1bf8b12..149b43d92 100644 --- a/tests/unit/Rules/FloatValTest.php +++ b/tests/unit/Rules/FloatValTest.php @@ -17,10 +17,8 @@ #[CoversClass(FloatVal::class)] final class FloatValTest extends RuleTestCase { - /** - * @return array - */ - public static function providerForValidInput(): array + /** @return iterable */ + public static function providerForValidInput(): iterable { $rule = new FloatVal(); @@ -37,10 +35,8 @@ public static function providerForValidInput(): array ]; } - /** - * @return array - */ - public static function providerForInvalidInput(): array + /** @return iterable */ + public static function providerForInvalidInput(): iterable { $rule = new FloatVal(); diff --git a/tests/unit/Rules/GraphTest.php b/tests/unit/Rules/GraphTest.php index a6df7af90..b894f4912 100644 --- a/tests/unit/Rules/GraphTest.php +++ b/tests/unit/Rules/GraphTest.php @@ -18,10 +18,8 @@ #[CoversClass(Graph::class)] final class GraphTest extends RuleTestCase { - /** - * @return array - */ - public static function providerForValidInput(): array + /** @return iterable */ + public static function providerForValidInput(): iterable { $graph = new Graph(); @@ -40,10 +38,8 @@ public static function providerForValidInput(): array ]; } - /** - * @return array - */ - public static function providerForInvalidInput(): array + /** @return iterable */ + public static function providerForInvalidInput(): iterable { $graph = new Graph(); diff --git a/tests/unit/Rules/GreaterThanTest.php b/tests/unit/Rules/GreaterThanTest.php index 2630a26b2..a272a3ccb 100644 --- a/tests/unit/Rules/GreaterThanTest.php +++ b/tests/unit/Rules/GreaterThanTest.php @@ -19,10 +19,8 @@ #[CoversClass(GreaterThan::class)] final class GreaterThanTest extends RuleTestCase { - /** - * @return array - */ - public static function providerForValidInput(): array + /** @return iterable */ + public static function providerForValidInput(): iterable { return [ [new GreaterThan(10), 11], @@ -33,10 +31,8 @@ public static function providerForValidInput(): array ]; } - /** - * @return array - */ - public static function providerForInvalidInput(): array + /** @return iterable */ + public static function providerForInvalidInput(): iterable { return [ [new GreaterThan(10), 9], diff --git a/tests/unit/Rules/HexRgbColorTest.php b/tests/unit/Rules/HexRgbColorTest.php index 2b25a5578..d920138e5 100644 --- a/tests/unit/Rules/HexRgbColorTest.php +++ b/tests/unit/Rules/HexRgbColorTest.php @@ -18,10 +18,8 @@ #[CoversClass(HexRgbColor::class)] final class HexRgbColorTest extends RuleTestCase { - /** - * @return array - */ - public static function providerForValidInput(): array + /** @return iterable */ + public static function providerForValidInput(): iterable { $sut = new HexRgbColor(); @@ -40,10 +38,8 @@ public static function providerForValidInput(): array ]; } - /** - * @return array - */ - public static function providerForInvalidInput(): array + /** @return iterable */ + public static function providerForInvalidInput(): iterable { $sut = new HexRgbColor(); diff --git a/tests/unit/Rules/IbanTest.php b/tests/unit/Rules/IbanTest.php index 9a9e009f0..11dff3889 100644 --- a/tests/unit/Rules/IbanTest.php +++ b/tests/unit/Rules/IbanTest.php @@ -20,10 +20,8 @@ #[CoversClass(Iban::class)] final class IbanTest extends RuleTestCase { - /** - * @return array - */ - public static function providerForValidInput(): array + /** @return iterable */ + public static function providerForValidInput(): iterable { $sut = new Iban(); @@ -42,10 +40,8 @@ public static function providerForValidInput(): array ]; } - /** - * @return array - */ - public static function providerForInvalidInput(): array + /** @return iterable */ + public static function providerForInvalidInput(): iterable { $sut = new Iban(); diff --git a/tests/unit/Rules/IdenticalTest.php b/tests/unit/Rules/IdenticalTest.php index 21fb93491..e76cf4d93 100644 --- a/tests/unit/Rules/IdenticalTest.php +++ b/tests/unit/Rules/IdenticalTest.php @@ -29,10 +29,8 @@ public function shouldPassCompareToParameterToException(): void self::assertSame($compareTo, $exception->getParam('compareTo')); } - /** - * @return array - */ - public static function providerForValidInput(): array + /** @return iterable */ + public static function providerForValidInput(): iterable { $object = new stdClass(); @@ -45,10 +43,8 @@ public static function providerForValidInput(): array ]; } - /** - * @return array - */ - public static function providerForInvalidInput(): array + /** @return iterable */ + public static function providerForInvalidInput(): iterable { return [ [new Identical(42), '42'], diff --git a/tests/unit/Rules/ImageTest.php b/tests/unit/Rules/ImageTest.php index 50bf147ef..07cfef03c 100644 --- a/tests/unit/Rules/ImageTest.php +++ b/tests/unit/Rules/ImageTest.php @@ -38,10 +38,8 @@ public function shouldValidateWithDefinedInstanceOfFileInfo(): void self::assertTrue($rule->validate($input)); } - /** - * @return array - */ - public static function providerForValidInput(): array + /** @return iterable */ + public static function providerForValidInput(): iterable { $rule = new Image(); @@ -55,10 +53,8 @@ public static function providerForValidInput(): array ]; } - /** - * @return array - */ - public static function providerForInvalidInput(): array + /** @return iterable */ + public static function providerForInvalidInput(): iterable { $rule = new Image(); diff --git a/tests/unit/Rules/ImeiTest.php b/tests/unit/Rules/ImeiTest.php index 071065cd4..9a4526d7c 100644 --- a/tests/unit/Rules/ImeiTest.php +++ b/tests/unit/Rules/ImeiTest.php @@ -18,10 +18,8 @@ #[CoversClass(Imei::class)] final class ImeiTest extends RuleTestCase { - /** - * @return array - */ - public static function providerForValidInput(): array + /** @return iterable */ + public static function providerForValidInput(): iterable { $rule = new Imei(); @@ -37,10 +35,8 @@ public static function providerForValidInput(): array ]; } - /** - * @return array - */ - public static function providerForInvalidInput(): array + /** @return iterable */ + public static function providerForInvalidInput(): iterable { $rule = new Imei(); diff --git a/tests/unit/Rules/InTest.php b/tests/unit/Rules/InTest.php index fb3e6beef..4e6f40793 100644 --- a/tests/unit/Rules/InTest.php +++ b/tests/unit/Rules/InTest.php @@ -17,10 +17,8 @@ #[CoversClass(In::class)] final class InTest extends RuleTestCase { - /** - * @return array - */ - public static function providerForValidInput(): array + /** @return iterable */ + public static function providerForValidInput(): iterable { return [ [new In(''), ''], @@ -36,10 +34,8 @@ public static function providerForValidInput(): array ]; } - /** - * @return array - */ - public static function providerForInvalidInput(): array + /** @return iterable */ + public static function providerForInvalidInput(): iterable { return [ [new In('0'), null], diff --git a/tests/unit/Rules/InfiniteTest.php b/tests/unit/Rules/InfiniteTest.php index 87d741610..bcbdd604d 100644 --- a/tests/unit/Rules/InfiniteTest.php +++ b/tests/unit/Rules/InfiniteTest.php @@ -21,10 +21,8 @@ #[CoversClass(Infinite::class)] final class InfiniteTest extends RuleTestCase { - /** - * @return array - */ - public static function providerForValidInput(): array + /** @return iterable */ + public static function providerForValidInput(): iterable { $rule = new Infinite(); @@ -34,10 +32,8 @@ public static function providerForValidInput(): array ]; } - /** - * @return array - */ - public static function providerForInvalidInput(): array + /** @return iterable */ + public static function providerForInvalidInput(): iterable { $rule = new Infinite(); diff --git a/tests/unit/Rules/InstanceTest.php b/tests/unit/Rules/InstanceTest.php index 2b4739e8c..fd2fd3c9a 100644 --- a/tests/unit/Rules/InstanceTest.php +++ b/tests/unit/Rules/InstanceTest.php @@ -23,10 +23,8 @@ #[CoversClass(Instance::class)] final class InstanceTest extends RuleTestCase { - /** - * @return array - */ - public static function providerForValidInput(): array + /** @return iterable */ + public static function providerForValidInput(): iterable { return [ [new Instance(DateTime::class), new DateTime()], @@ -35,10 +33,8 @@ public static function providerForValidInput(): array ]; } - /** - * @return array - */ - public static function providerForInvalidInput(): array + /** @return iterable */ + public static function providerForInvalidInput(): iterable { return [ [new Instance(DateTime::class), ''], diff --git a/tests/unit/Rules/IntTypeTest.php b/tests/unit/Rules/IntTypeTest.php index e3a6ef407..3aa4ef7ff 100644 --- a/tests/unit/Rules/IntTypeTest.php +++ b/tests/unit/Rules/IntTypeTest.php @@ -19,10 +19,8 @@ #[CoversClass(IntType::class)] final class IntTypeTest extends RuleTestCase { - /** - * @return array - */ - public static function providerForValidInput(): array + /** @return iterable */ + public static function providerForValidInput(): iterable { $rule = new IntType(); @@ -34,10 +32,8 @@ public static function providerForValidInput(): array ]; } - /** - * @return array - */ - public static function providerForInvalidInput(): array + /** @return iterable */ + public static function providerForInvalidInput(): iterable { $rule = new IntType(); diff --git a/tests/unit/Rules/IntValTest.php b/tests/unit/Rules/IntValTest.php index cc4f72a88..6096c19f5 100644 --- a/tests/unit/Rules/IntValTest.php +++ b/tests/unit/Rules/IntValTest.php @@ -20,10 +20,8 @@ #[CoversClass(IntVal::class)] final class IntValTest extends RuleTestCase { - /** - * @return array - */ - public static function providerForValidInput(): array + /** @return iterable */ + public static function providerForValidInput(): iterable { $rule = new IntVal(); @@ -45,10 +43,8 @@ public static function providerForValidInput(): array ]; } - /** - * @return array - */ - public static function providerForInvalidInput(): array + /** @return iterable */ + public static function providerForInvalidInput(): iterable { $rule = new IntVal(); diff --git a/tests/unit/Rules/IpTest.php b/tests/unit/Rules/IpTest.php index e0a884933..454ea3afb 100644 --- a/tests/unit/Rules/IpTest.php +++ b/tests/unit/Rules/IpTest.php @@ -50,10 +50,8 @@ public static function providerForInvalidRanges(): array ]; } - /** - * @return array - */ - public static function providerForValidInput(): array + /** @return iterable */ + public static function providerForValidInput(): iterable { return [ [new Ip('127.*'), '127.0.0.1'], @@ -78,10 +76,8 @@ public static function providerForValidInput(): array ]; } - /** - * @return array - */ - public static function providerForInvalidInput(): array + /** @return iterable */ + public static function providerForInvalidInput(): iterable { return [ [new Ip('127.*'), '192.0.1.0'], diff --git a/tests/unit/Rules/IsbnTest.php b/tests/unit/Rules/IsbnTest.php index eb924cf38..a9b0579f6 100644 --- a/tests/unit/Rules/IsbnTest.php +++ b/tests/unit/Rules/IsbnTest.php @@ -17,10 +17,8 @@ #[CoversClass(Isbn::class)] final class IsbnTest extends RuleTestCase { - /** - * @return array - */ - public static function providerForValidInput(): array + /** @return iterable */ + public static function providerForValidInput(): iterable { $sut = new Isbn(); @@ -35,10 +33,8 @@ public static function providerForValidInput(): array ]; } - /** - * @return array - */ - public static function providerForInvalidInput(): array + /** @return iterable */ + public static function providerForInvalidInput(): iterable { $sut = new Isbn(); diff --git a/tests/unit/Rules/IterableTypeTest.php b/tests/unit/Rules/IterableTypeTest.php index 65f1e08e9..c710cf083 100644 --- a/tests/unit/Rules/IterableTypeTest.php +++ b/tests/unit/Rules/IterableTypeTest.php @@ -19,10 +19,8 @@ #[CoversClass(IterableType::class)] final class IterableTypeTest extends RuleTestCase { - /** - * @return array - */ - public static function providerForValidInput(): array + /** @return iterable */ + public static function providerForValidInput(): iterable { $rule = new IterableType(); @@ -33,10 +31,8 @@ public static function providerForValidInput(): array ]; } - /** - * @return array - */ - public static function providerForInvalidInput(): array + /** @return iterable */ + public static function providerForInvalidInput(): iterable { $rule = new IterableType(); diff --git a/tests/unit/Rules/JsonTest.php b/tests/unit/Rules/JsonTest.php index dc35f1ebd..f54f77ef0 100644 --- a/tests/unit/Rules/JsonTest.php +++ b/tests/unit/Rules/JsonTest.php @@ -18,10 +18,8 @@ #[CoversClass(Json::class)] final class JsonTest extends RuleTestCase { - /** - * @return array - */ - public static function providerForValidInput(): array + /** @return iterable */ + public static function providerForValidInput(): iterable { $json = new Json(); @@ -38,10 +36,8 @@ public static function providerForValidInput(): array ]; } - /** - * @return array - */ - public static function providerForInvalidInput(): array + /** @return iterable */ + public static function providerForInvalidInput(): iterable { $json = new Json(); diff --git a/tests/unit/Rules/KeyValueTest.php b/tests/unit/Rules/KeyValueTest.php index ae02cdeee..93e247b0a 100644 --- a/tests/unit/Rules/KeyValueTest.php +++ b/tests/unit/Rules/KeyValueTest.php @@ -17,10 +17,8 @@ #[CoversClass(KeyValue::class)] final class KeyValueTest extends RuleTestCase { - /** - * @return array - */ - public static function providerForValidInput(): array + /** @return iterable */ + public static function providerForValidInput(): iterable { return [ 'Equal values' => [new KeyValue('foo', 'equals', 'bar'), ['foo' => 42, 'bar' => 42]], @@ -35,10 +33,8 @@ public static function providerForValidInput(): array ]; } - /** - * @return array - */ - public static function providerForInvalidInput(): array + /** @return iterable */ + public static function providerForInvalidInput(): iterable { $keyValue = new KeyValue('foo', 'equals', 'bar'); diff --git a/tests/unit/Rules/LanguageCodeTest.php b/tests/unit/Rules/LanguageCodeTest.php index 586daaf10..d2eaeff39 100644 --- a/tests/unit/Rules/LanguageCodeTest.php +++ b/tests/unit/Rules/LanguageCodeTest.php @@ -28,10 +28,8 @@ public function itShouldThrowAnExceptionWhenSetIsInvalid(): void new LanguageCode('foo'); } - /** - * @return array - */ - public static function providerForValidInput(): array + /** @return iterable */ + public static function providerForValidInput(): iterable { $sutAlpha2 = new LanguageCode(LanguageCode::ALPHA2); $sutAlpha3 = new LanguageCode(LanguageCode::ALPHA3); @@ -48,10 +46,8 @@ public static function providerForValidInput(): array ]; } - /** - * @return array - */ - public static function providerForInvalidInput(): array + /** @return iterable */ + public static function providerForInvalidInput(): iterable { $sutAlpha2 = new LanguageCode(LanguageCode::ALPHA2); $sutAlpha3 = new LanguageCode(LanguageCode::ALPHA3); diff --git a/tests/unit/Rules/LeapDateTest.php b/tests/unit/Rules/LeapDateTest.php index fc5bac5de..bb4acca6e 100644 --- a/tests/unit/Rules/LeapDateTest.php +++ b/tests/unit/Rules/LeapDateTest.php @@ -18,10 +18,8 @@ #[CoversClass(LeapDate::class)] final class LeapDateTest extends RuleTestCase { - /** - * @return array - */ - public static function providerForValidInput(): array + /** @return iterable */ + public static function providerForValidInput(): iterable { return [ [new LeapDate('Y-m-d'), '1988-02-29'], @@ -31,10 +29,8 @@ public static function providerForValidInput(): array ]; } - /** - * @return array - */ - public static function providerForInvalidInput(): array + /** @return iterable */ + public static function providerForInvalidInput(): iterable { return [ [new LeapDate('Y-m-d'), '1989-02-29'], diff --git a/tests/unit/Rules/LeapYearTest.php b/tests/unit/Rules/LeapYearTest.php index 690723cb3..0155baf3f 100644 --- a/tests/unit/Rules/LeapYearTest.php +++ b/tests/unit/Rules/LeapYearTest.php @@ -18,10 +18,8 @@ #[CoversClass(LeapYear::class)] final class LeapYearTest extends RuleTestCase { - /** - * @return array - */ - public static function providerForValidInput(): array + /** @return iterable */ + public static function providerForValidInput(): iterable { $rule = new LeapYear(); @@ -34,10 +32,8 @@ public static function providerForValidInput(): array ]; } - /** - * @return array - */ - public static function providerForInvalidInput(): array + /** @return iterable */ + public static function providerForInvalidInput(): iterable { $rule = new LeapYear(); diff --git a/tests/unit/Rules/LengthTest.php b/tests/unit/Rules/LengthTest.php index d143873df..c48f3aee2 100644 --- a/tests/unit/Rules/LengthTest.php +++ b/tests/unit/Rules/LengthTest.php @@ -32,10 +32,8 @@ public function isShouldNotNotAcceptInvalidLengths(): void new Length(10, 1); } - /** - * @return array - */ - public static function providerForValidInput(): array + /** @return iterable */ + public static function providerForValidInput(): iterable { return [ [new Length(1, 15), 'alganet'], @@ -55,10 +53,8 @@ public static function providerForValidInput(): array ]; } - /** - * @return array - */ - public static function providerForInvalidInput(): array + /** @return iterable */ + public static function providerForInvalidInput(): iterable { return [ [new Length(1, 15), ''], diff --git a/tests/unit/Rules/LessThanTest.php b/tests/unit/Rules/LessThanTest.php index 2820c0c36..4c1303668 100644 --- a/tests/unit/Rules/LessThanTest.php +++ b/tests/unit/Rules/LessThanTest.php @@ -19,10 +19,8 @@ #[CoversClass(LessThan::class)] final class LessThanTest extends RuleTestCase { - /** - * @return array - */ - public static function providerForValidInput(): array + /** @return iterable */ + public static function providerForValidInput(): iterable { return [ [new LessThan(10), 9], @@ -33,10 +31,8 @@ public static function providerForValidInput(): array ]; } - /** - * @return array - */ - public static function providerForInvalidInput(): array + /** @return iterable */ + public static function providerForInvalidInput(): iterable { return [ [new LessThan(10), 10], diff --git a/tests/unit/Rules/LowercaseTest.php b/tests/unit/Rules/LowercaseTest.php index c992d0879..2c920d852 100644 --- a/tests/unit/Rules/LowercaseTest.php +++ b/tests/unit/Rules/LowercaseTest.php @@ -18,10 +18,8 @@ #[CoversClass(Lowercase::class)] final class LowercaseTest extends RuleTestCase { - /** - * @return array - */ - public static function providerForValidInput(): array + /** @return iterable */ + public static function providerForValidInput(): iterable { $rule = new Lowercase(); @@ -39,10 +37,8 @@ public static function providerForValidInput(): array ]; } - /** - * @return array - */ - public static function providerForInvalidInput(): array + /** @return iterable */ + public static function providerForInvalidInput(): iterable { $rule = new Lowercase(); diff --git a/tests/unit/Rules/LuhnTest.php b/tests/unit/Rules/LuhnTest.php index 135b6990a..792b9be82 100644 --- a/tests/unit/Rules/LuhnTest.php +++ b/tests/unit/Rules/LuhnTest.php @@ -18,10 +18,8 @@ #[CoversClass(Luhn::class)] final class LuhnTest extends RuleTestCase { - /** - * @return array - */ - public static function providerForValidInput(): array + /** @return iterable */ + public static function providerForValidInput(): iterable { $rule = new Luhn(); @@ -32,10 +30,8 @@ public static function providerForValidInput(): array ]; } - /** - * @return array - */ - public static function providerForInvalidInput(): array + /** @return iterable */ + public static function providerForInvalidInput(): iterable { $rule = new Luhn(); diff --git a/tests/unit/Rules/MacAddressTest.php b/tests/unit/Rules/MacAddressTest.php index fb6c7a7d0..792b80378 100644 --- a/tests/unit/Rules/MacAddressTest.php +++ b/tests/unit/Rules/MacAddressTest.php @@ -22,10 +22,8 @@ #[CoversClass(MacAddress::class)] final class MacAddressTest extends RuleTestCase { - /** - * @return array - */ - public static function providerForValidInput(): array + /** @return iterable */ + public static function providerForValidInput(): iterable { $sut = new MacAddress(); @@ -37,10 +35,8 @@ public static function providerForValidInput(): array ]; } - /** - * @return array - */ - public static function providerForInvalidInput(): array + /** @return iterable */ + public static function providerForInvalidInput(): iterable { $sut = new MacAddress(); diff --git a/tests/unit/Rules/MaxAgeTest.php b/tests/unit/Rules/MaxAgeTest.php index 0cfdf9576..022308a9c 100644 --- a/tests/unit/Rules/MaxAgeTest.php +++ b/tests/unit/Rules/MaxAgeTest.php @@ -24,10 +24,8 @@ #[CoversClass(MaxAge::class)] final class MaxAgeTest extends RuleTestCase { - /** - * @return array - */ - public static function providerForValidInput(): array + /** @return iterable */ + public static function providerForValidInput(): iterable { return [ [new MaxAge(30, 'Y-m-d'), date('Y-m-d', strtotime('30 years ago'))], @@ -37,10 +35,8 @@ public static function providerForValidInput(): array ]; } - /** - * @return array - */ - public static function providerForInvalidInput(): array + /** @return iterable */ + public static function providerForInvalidInput(): iterable { return [ [new MaxAge(30), new DateTime('30 years ago')], diff --git a/tests/unit/Rules/MaxTest.php b/tests/unit/Rules/MaxTest.php index 6f375f7d6..2e3fdcaa9 100644 --- a/tests/unit/Rules/MaxTest.php +++ b/tests/unit/Rules/MaxTest.php @@ -21,10 +21,8 @@ #[CoversClass(Max::class)] final class MaxTest extends RuleTestCase { - /** - * @return array - */ - public static function providerForValidInput(): array + /** @return iterable */ + public static function providerForValidInput(): iterable { return [ [new Max(10), 9], @@ -37,10 +35,8 @@ public static function providerForValidInput(): array ]; } - /** - * @return array - */ - public static function providerForInvalidInput(): array + /** @return iterable */ + public static function providerForInvalidInput(): iterable { return [ [new Max(10), 11], diff --git a/tests/unit/Rules/MimetypeTest.php b/tests/unit/Rules/MimetypeTest.php index 4bb8cdf47..910d5a26b 100644 --- a/tests/unit/Rules/MimetypeTest.php +++ b/tests/unit/Rules/MimetypeTest.php @@ -49,10 +49,8 @@ public function itShouldValidateWithDefinedFinfoInstance(): void self::assertTrue($rule->validate($filename)); } - /** - * @return array - */ - public static function providerForValidInput(): array + /** @return iterable */ + public static function providerForValidInput(): iterable { return [ 'image/png' => [new Mimetype('image/png'), 'tests/fixtures/valid-image.png'], @@ -64,10 +62,8 @@ public static function providerForValidInput(): array ]; } - /** - * @return array - */ - public static function providerForInvalidInput(): array + /** @return iterable */ + public static function providerForInvalidInput(): iterable { return [ 'invalid file' => [new Mimetype('image/png'), 'tests/fixtures/invalid-image.png'], diff --git a/tests/unit/Rules/MinAgeTest.php b/tests/unit/Rules/MinAgeTest.php index 219f2f8cf..4763a18b9 100644 --- a/tests/unit/Rules/MinAgeTest.php +++ b/tests/unit/Rules/MinAgeTest.php @@ -24,10 +24,8 @@ #[CoversClass(MinAge::class)] final class MinAgeTest extends RuleTestCase { - /** - * @return array - */ - public static function providerForValidInput(): array + /** @return iterable */ + public static function providerForValidInput(): iterable { return [ [new MinAge(18, 'Y-m-d'), date('Y-m-d', strtotime('18 years ago'))], @@ -37,10 +35,8 @@ public static function providerForValidInput(): array ]; } - /** - * @return array - */ - public static function providerForInvalidInput(): array + /** @return iterable */ + public static function providerForInvalidInput(): iterable { return [ [new MinAge(18), new DateTime('18 years ago')], diff --git a/tests/unit/Rules/MinTest.php b/tests/unit/Rules/MinTest.php index 767823b10..dee667113 100644 --- a/tests/unit/Rules/MinTest.php +++ b/tests/unit/Rules/MinTest.php @@ -21,10 +21,8 @@ #[CoversClass(Min::class)] final class MinTest extends RuleTestCase { - /** - * @return array - */ - public static function providerForValidInput(): array + /** @return iterable */ + public static function providerForValidInput(): iterable { return [ // From documentation @@ -52,10 +50,8 @@ public static function providerForValidInput(): array ]; } - /** - * @return array - */ - public static function providerForInvalidInput(): array + /** @return iterable */ + public static function providerForInvalidInput(): iterable { return [ // From documentation diff --git a/tests/unit/Rules/MultipleTest.php b/tests/unit/Rules/MultipleTest.php index d81c1a253..8646086fe 100644 --- a/tests/unit/Rules/MultipleTest.php +++ b/tests/unit/Rules/MultipleTest.php @@ -17,10 +17,8 @@ #[CoversClass(Multiple::class)] final class MultipleTest extends RuleTestCase { - /** - * @return array - */ - public static function providerForValidInput(): array + /** @return iterable */ + public static function providerForValidInput(): iterable { return [ [new Multiple(5), 20], @@ -35,10 +33,8 @@ public static function providerForValidInput(): array ]; } - /** - * @return array - */ - public static function providerForInvalidInput(): array + /** @return iterable */ + public static function providerForInvalidInput(): iterable { return [ [new Multiple(5), 11], diff --git a/tests/unit/Rules/NegativeTest.php b/tests/unit/Rules/NegativeTest.php index dc29e9d6a..6df9ecee6 100644 --- a/tests/unit/Rules/NegativeTest.php +++ b/tests/unit/Rules/NegativeTest.php @@ -18,10 +18,8 @@ #[CoversClass(Negative::class)] final class NegativeTest extends RuleTestCase { - /** - * @return array - */ - public static function providerForValidInput(): array + /** @return iterable */ + public static function providerForValidInput(): iterable { $rule = new Negative(); @@ -32,10 +30,8 @@ public static function providerForValidInput(): array ]; } - /** - * @return array - */ - public static function providerForInvalidInput(): array + /** @return iterable */ + public static function providerForInvalidInput(): iterable { $rule = new Negative(); diff --git a/tests/unit/Rules/NfeAccessKeyTest.php b/tests/unit/Rules/NfeAccessKeyTest.php index f2440b229..d80fde448 100644 --- a/tests/unit/Rules/NfeAccessKeyTest.php +++ b/tests/unit/Rules/NfeAccessKeyTest.php @@ -17,10 +17,8 @@ #[CoversClass(NfeAccessKey::class)] final class NfeAccessKeyTest extends RuleTestCase { - /** - * @return array - */ - public static function providerForValidInput(): array + /** @return iterable */ + public static function providerForValidInput(): iterable { $nfe = new NfeAccessKey(); @@ -29,10 +27,8 @@ public static function providerForValidInput(): array ]; } - /** - * @return array - */ - public static function providerForInvalidInput(): array + /** @return iterable */ + public static function providerForInvalidInput(): iterable { $nfe = new NfeAccessKey(); diff --git a/tests/unit/Rules/NifTest.php b/tests/unit/Rules/NifTest.php index e044c6217..d8942a9fb 100644 --- a/tests/unit/Rules/NifTest.php +++ b/tests/unit/Rules/NifTest.php @@ -20,10 +20,8 @@ #[CoversClass(Nif::class)] final class NifTest extends RuleTestCase { - /** - * @return array - */ - public static function providerForValidInput(): array + /** @return iterable */ + public static function providerForValidInput(): iterable { $rule = new Nif(); @@ -52,10 +50,8 @@ public static function providerForValidInput(): array ]; } - /** - * @return array - */ - public static function providerForInvalidInput(): array + /** @return iterable */ + public static function providerForInvalidInput(): iterable { $rule = new Nif(); diff --git a/tests/unit/Rules/NipTest.php b/tests/unit/Rules/NipTest.php index 4c233320d..60a30f2e1 100644 --- a/tests/unit/Rules/NipTest.php +++ b/tests/unit/Rules/NipTest.php @@ -18,10 +18,8 @@ #[CoversClass(Nip::class)] final class NipTest extends RuleTestCase { - /** - * @return array - */ - public static function providerForValidInput(): array + /** @return iterable */ + public static function providerForValidInput(): iterable { $rule = new Nip(); @@ -32,10 +30,8 @@ public static function providerForValidInput(): array ]; } - /** - * @return array - */ - public static function providerForInvalidInput(): array + /** @return iterable */ + public static function providerForInvalidInput(): iterable { $rule = new Nip(); diff --git a/tests/unit/Rules/NoTest.php b/tests/unit/Rules/NoTest.php index 3453e4299..5496f70d1 100644 --- a/tests/unit/Rules/NoTest.php +++ b/tests/unit/Rules/NoTest.php @@ -76,10 +76,8 @@ public static function providerForInvalidInputWithLocale(): array ]; } - /** - * @return array - */ - public static function providerForValidInput(): array + /** @return iterable */ + public static function providerForValidInput(): iterable { $sut = new No(); @@ -93,10 +91,8 @@ public static function providerForValidInput(): array ]; } - /** - * @return array - */ - public static function providerForInvalidInput(): array + /** @return iterable */ + public static function providerForInvalidInput(): iterable { $sut = new No(); diff --git a/tests/unit/Rules/NoWhitespaceTest.php b/tests/unit/Rules/NoWhitespaceTest.php index edb05c830..751712b1a 100644 --- a/tests/unit/Rules/NoWhitespaceTest.php +++ b/tests/unit/Rules/NoWhitespaceTest.php @@ -17,10 +17,8 @@ #[CoversClass(NoWhitespace::class)] final class NoWhitespaceTest extends RuleTestCase { - /** - * @return array - */ - public static function providerForValidInput(): array + /** @return iterable */ + public static function providerForValidInput(): iterable { $rule = new NoWhitespace(); @@ -33,10 +31,8 @@ public static function providerForValidInput(): array ]; } - /** - * @return array - */ - public static function providerForInvalidInput(): array + /** @return iterable */ + public static function providerForInvalidInput(): iterable { $rule = new NoWhitespace(); diff --git a/tests/unit/Rules/NotBlankTest.php b/tests/unit/Rules/NotBlankTest.php index 5a3e31dee..ae256b475 100644 --- a/tests/unit/Rules/NotBlankTest.php +++ b/tests/unit/Rules/NotBlankTest.php @@ -18,10 +18,8 @@ #[CoversClass(NotBlank::class)] final class NotBlankTest extends RuleTestCase { - /** - * @return array - */ - public static function providerForValidInput(): array + /** @return iterable */ + public static function providerForValidInput(): iterable { $object = new stdClass(); $object->foo = true; @@ -37,10 +35,8 @@ public static function providerForValidInput(): array ]; } - /** - * @return array - */ - public static function providerForInvalidInput(): array + /** @return iterable */ + public static function providerForInvalidInput(): iterable { $rule = new NotBlank(); diff --git a/tests/unit/Rules/NotEmojiTest.php b/tests/unit/Rules/NotEmojiTest.php index d99c71a33..3cb501c80 100644 --- a/tests/unit/Rules/NotEmojiTest.php +++ b/tests/unit/Rules/NotEmojiTest.php @@ -18,10 +18,8 @@ #[CoversClass(NotEmoji::class)] final class NotEmojiTest extends RuleTestCase { - /** - * @return array - */ - public static function providerForValidInput(): array + /** @return iterable */ + public static function providerForValidInput(): iterable { $sut = new NotEmoji(); @@ -36,10 +34,8 @@ public static function providerForValidInput(): array ]; } - /** - * @return array - */ - public static function providerForInvalidInput(): array + /** @return iterable */ + public static function providerForInvalidInput(): iterable { $sut = new NotEmoji(); diff --git a/tests/unit/Rules/NotEmptyTest.php b/tests/unit/Rules/NotEmptyTest.php index 69ae08864..412d0ef98 100644 --- a/tests/unit/Rules/NotEmptyTest.php +++ b/tests/unit/Rules/NotEmptyTest.php @@ -18,10 +18,8 @@ #[CoversClass(NotEmpty::class)] final class NotEmptyTest extends RuleTestCase { - /** - * @return array - */ - public static function providerForValidInput(): array + /** @return iterable */ + public static function providerForValidInput(): iterable { $rule = new NotEmpty(); @@ -34,10 +32,8 @@ public static function providerForValidInput(): array ]; } - /** - * @return array - */ - public static function providerForInvalidInput(): array + /** @return iterable */ + public static function providerForInvalidInput(): iterable { $rule = new NotEmpty(); diff --git a/tests/unit/Rules/NotOptionalTest.php b/tests/unit/Rules/NotOptionalTest.php index f0dac6f94..a9a2e3cb2 100644 --- a/tests/unit/Rules/NotOptionalTest.php +++ b/tests/unit/Rules/NotOptionalTest.php @@ -18,10 +18,8 @@ #[CoversClass(NotOptional::class)] final class NotOptionalTest extends RuleTestCase { - /** - * @return array - */ - public static function providerForValidInput(): array + /** @return iterable */ + public static function providerForValidInput(): iterable { $rule = new NotOptional(); @@ -43,10 +41,8 @@ public static function providerForValidInput(): array ]; } - /** - * @return array - */ - public static function providerForInvalidInput(): array + /** @return iterable */ + public static function providerForInvalidInput(): iterable { $rule = new NotOptional(); diff --git a/tests/unit/Rules/NullTypeTest.php b/tests/unit/Rules/NullTypeTest.php index 2e2a9d56e..f28b8ad11 100644 --- a/tests/unit/Rules/NullTypeTest.php +++ b/tests/unit/Rules/NullTypeTest.php @@ -17,10 +17,8 @@ #[CoversClass(NullType::class)] final class NullTypeTest extends RuleTestCase { - /** - * @return array - */ - public static function providerForValidInput(): array + /** @return iterable */ + public static function providerForValidInput(): iterable { $rule = new NullType(); @@ -29,10 +27,8 @@ public static function providerForValidInput(): array ]; } - /** - * @return array - */ - public static function providerForInvalidInput(): array + /** @return iterable */ + public static function providerForInvalidInput(): iterable { $rule = new NullType(); diff --git a/tests/unit/Rules/NumberTest.php b/tests/unit/Rules/NumberTest.php index 123fd94e9..9315ba12b 100644 --- a/tests/unit/Rules/NumberTest.php +++ b/tests/unit/Rules/NumberTest.php @@ -25,10 +25,8 @@ #[CoversClass(Number::class)] final class NumberTest extends RuleTestCase { - /** - * @return array - */ - public static function providerForValidInput(): array + /** @return iterable */ + public static function providerForValidInput(): iterable { $rule = new Number(); @@ -44,10 +42,8 @@ public static function providerForValidInput(): array ]; } - /** - * @return array - */ - public static function providerForInvalidInput(): array + /** @return iterable */ + public static function providerForInvalidInput(): iterable { $rule = new Number(); diff --git a/tests/unit/Rules/NumericValTest.php b/tests/unit/Rules/NumericValTest.php index 08b6dbcc7..5907b00ca 100644 --- a/tests/unit/Rules/NumericValTest.php +++ b/tests/unit/Rules/NumericValTest.php @@ -17,10 +17,8 @@ #[CoversClass(NumericVal::class)] final class NumericValTest extends RuleTestCase { - /** - * @return array - */ - public static function providerForValidInput(): array + /** @return iterable */ + public static function providerForValidInput(): iterable { $numericVal = new NumericVal(); @@ -34,10 +32,8 @@ public static function providerForValidInput(): array ]; } - /** - * @return array - */ - public static function providerForInvalidInput(): array + /** @return iterable */ + public static function providerForInvalidInput(): iterable { $numericVal = new NumericVal(); diff --git a/tests/unit/Rules/ObjectTypeTest.php b/tests/unit/Rules/ObjectTypeTest.php index 56b796ed8..7a1851a1a 100644 --- a/tests/unit/Rules/ObjectTypeTest.php +++ b/tests/unit/Rules/ObjectTypeTest.php @@ -19,10 +19,8 @@ #[CoversClass(ObjectType::class)] final class ObjectTypeTest extends RuleTestCase { - /** - * @return array - */ - public static function providerForValidInput(): array + /** @return iterable */ + public static function providerForValidInput(): iterable { $rule = new ObjectType(); @@ -32,10 +30,8 @@ public static function providerForValidInput(): array ]; } - /** - * @return array - */ - public static function providerForInvalidInput(): array + /** @return iterable */ + public static function providerForInvalidInput(): iterable { $rule = new ObjectType(); diff --git a/tests/unit/Rules/OddTest.php b/tests/unit/Rules/OddTest.php index 6aa480b3e..44a2d5f82 100644 --- a/tests/unit/Rules/OddTest.php +++ b/tests/unit/Rules/OddTest.php @@ -20,10 +20,8 @@ #[CoversClass(Odd::class)] final class OddTest extends RuleTestCase { - /** - * @return array - */ - public static function providerForValidInput(): array + /** @return iterable */ + public static function providerForValidInput(): iterable { $rule = new Odd(); @@ -35,10 +33,8 @@ public static function providerForValidInput(): array ]; } - /** - * @return array - */ - public static function providerForInvalidInput(): array + /** @return iterable */ + public static function providerForInvalidInput(): iterable { $rule = new Odd(); diff --git a/tests/unit/Rules/PerfectSquareTest.php b/tests/unit/Rules/PerfectSquareTest.php index ceb415a4a..a730dca24 100644 --- a/tests/unit/Rules/PerfectSquareTest.php +++ b/tests/unit/Rules/PerfectSquareTest.php @@ -17,10 +17,8 @@ #[CoversClass(PerfectSquare::class)] final class PerfectSquareTest extends RuleTestCase { - /** - * @return array - */ - public static function providerForValidInput(): array + /** @return iterable */ + public static function providerForValidInput(): iterable { $rule = new PerfectSquare(); @@ -38,10 +36,8 @@ public static function providerForValidInput(): array ]; } - /** - * @return array - */ - public static function providerForInvalidInput(): array + /** @return iterable */ + public static function providerForInvalidInput(): iterable { $rule = new PerfectSquare(); diff --git a/tests/unit/Rules/PeselTest.php b/tests/unit/Rules/PeselTest.php index e0ff476c4..6b9107bcb 100644 --- a/tests/unit/Rules/PeselTest.php +++ b/tests/unit/Rules/PeselTest.php @@ -17,10 +17,8 @@ #[CoversClass(Pesel::class)] final class PeselTest extends RuleTestCase { - /** - * @return array - */ - public static function providerForValidInput(): array + /** @return iterable */ + public static function providerForValidInput(): iterable { $rule = new Pesel(); @@ -36,10 +34,8 @@ public static function providerForValidInput(): array ]; } - /** - * @return array - */ - public static function providerForInvalidInput(): array + /** @return iterable */ + public static function providerForInvalidInput(): iterable { $rule = new Pesel(); diff --git a/tests/unit/Rules/PhoneTest.php b/tests/unit/Rules/PhoneTest.php index cf5aa2d30..8aa5dd8c6 100644 --- a/tests/unit/Rules/PhoneTest.php +++ b/tests/unit/Rules/PhoneTest.php @@ -38,10 +38,8 @@ public function testThrowsExceptionForInternationalNumbers(): void $phoneValidator->assert('abc'); } - /** - * @return array - */ - public static function providerForValidInput(): array + /** @return iterable */ + public static function providerForValidInput(): iterable { return [ [new Phone(), '+1 650 253 00 00'], @@ -55,10 +53,8 @@ public static function providerForValidInput(): array ]; } - /** - * @return array - */ - public static function providerForInvalidInput(): array + /** @return iterable */ + public static function providerForInvalidInput(): iterable { return [ [new Phone(), '+1-650-253-00-0'], diff --git a/tests/unit/Rules/PhpLabelTest.php b/tests/unit/Rules/PhpLabelTest.php index 66212a01a..86dfd71ca 100644 --- a/tests/unit/Rules/PhpLabelTest.php +++ b/tests/unit/Rules/PhpLabelTest.php @@ -24,10 +24,8 @@ #[CoversClass(PhpLabel::class)] final class PhpLabelTest extends RuleTestCase { - /** - * @return array - */ - public static function providerForValidInput(): array + /** @return iterable */ + public static function providerForValidInput(): iterable { $rule = new PhpLabel(); @@ -42,10 +40,8 @@ public static function providerForValidInput(): array ]; } - /** - * @return array - */ - public static function providerForInvalidInput(): array + /** @return iterable */ + public static function providerForInvalidInput(): iterable { $rule = new PhpLabel(); diff --git a/tests/unit/Rules/PisTest.php b/tests/unit/Rules/PisTest.php index e5b0eccf0..942c4a5a3 100644 --- a/tests/unit/Rules/PisTest.php +++ b/tests/unit/Rules/PisTest.php @@ -18,10 +18,8 @@ #[CoversClass(Pis::class)] final class PisTest extends RuleTestCase { - /** - * @return array - */ - public static function providerForValidInput(): array + /** @return iterable */ + public static function providerForValidInput(): iterable { $rule = new Pis(); @@ -40,10 +38,8 @@ public static function providerForValidInput(): array ]; } - /** - * @return array - */ - public static function providerForInvalidInput(): array + /** @return iterable */ + public static function providerForInvalidInput(): iterable { $rule = new Pis(); diff --git a/tests/unit/Rules/PolishIdCardTest.php b/tests/unit/Rules/PolishIdCardTest.php index 89c5637cd..326f7cb53 100644 --- a/tests/unit/Rules/PolishIdCardTest.php +++ b/tests/unit/Rules/PolishIdCardTest.php @@ -17,10 +17,8 @@ #[CoversClass(PolishIdCard::class)] final class PolishIdCardTest extends RuleTestCase { - /** - * @return array - */ - public static function providerForValidInput(): array + /** @return iterable */ + public static function providerForValidInput(): iterable { $rule = new PolishIdCard(); @@ -31,10 +29,8 @@ public static function providerForValidInput(): array ]; } - /** - * @return array - */ - public static function providerForInvalidInput(): array + /** @return iterable */ + public static function providerForInvalidInput(): iterable { $rule = new PolishIdCard(); diff --git a/tests/unit/Rules/PortugueseNifTest.php b/tests/unit/Rules/PortugueseNifTest.php index 090d163ef..c1fb4d800 100644 --- a/tests/unit/Rules/PortugueseNifTest.php +++ b/tests/unit/Rules/PortugueseNifTest.php @@ -16,10 +16,8 @@ final class PortugueseNifTest extends RuleTestCase { - /** - * @return array - */ - public static function providerForValidInput(): array + /** @return iterable */ + public static function providerForValidInput(): iterable { $rule = new PortugueseNif(); @@ -46,10 +44,8 @@ public static function providerForValidInput(): array ]; } - /** - * @return array - */ - public static function providerForInvalidInput(): array + /** @return iterable */ + public static function providerForInvalidInput(): iterable { $rule = new PortugueseNif(); diff --git a/tests/unit/Rules/PositiveTest.php b/tests/unit/Rules/PositiveTest.php index c69b88cbe..962d48b99 100644 --- a/tests/unit/Rules/PositiveTest.php +++ b/tests/unit/Rules/PositiveTest.php @@ -18,10 +18,8 @@ #[CoversClass(Positive::class)] final class PositiveTest extends RuleTestCase { - /** - * @return array - */ - public static function providerForValidInput(): array + /** @return iterable */ + public static function providerForValidInput(): iterable { $rule = new Positive(); @@ -33,10 +31,8 @@ public static function providerForValidInput(): array ]; } - /** - * @return array - */ - public static function providerForInvalidInput(): array + /** @return iterable */ + public static function providerForInvalidInput(): iterable { $rule = new Positive(); diff --git a/tests/unit/Rules/PostalCodeTest.php b/tests/unit/Rules/PostalCodeTest.php index 8aa922e7d..51ba17c1e 100644 --- a/tests/unit/Rules/PostalCodeTest.php +++ b/tests/unit/Rules/PostalCodeTest.php @@ -44,10 +44,8 @@ public function shouldThrowsExceptionWhenCountryCodeIsNotValid(): void new PostalCode('Whatever'); } - /** - * @return array - */ - public static function providerForValidInput(): array + /** @return iterable */ + public static function providerForValidInput(): iterable { return [ [new PostalCode('BR'), '02179-000'], @@ -84,10 +82,8 @@ public static function providerForValidInput(): array ]; } - /** - * @return array - */ - public static function providerForInvalidInput(): array + /** @return iterable */ + public static function providerForInvalidInput(): iterable { return [ [new PostalCode('BR'), '02179'], diff --git a/tests/unit/Rules/PrimeNumberTest.php b/tests/unit/Rules/PrimeNumberTest.php index 36e374af6..a7c82dbd2 100644 --- a/tests/unit/Rules/PrimeNumberTest.php +++ b/tests/unit/Rules/PrimeNumberTest.php @@ -17,10 +17,8 @@ #[CoversClass(PrimeNumber::class)] final class PrimeNumberTest extends RuleTestCase { - /** - * @return array - */ - public static function providerForValidInput(): array + /** @return iterable */ + public static function providerForValidInput(): iterable { $rule = new PrimeNumber(); @@ -34,10 +32,8 @@ public static function providerForValidInput(): array ]; } - /** - * @return array - */ - public static function providerForInvalidInput(): array + /** @return iterable */ + public static function providerForInvalidInput(): iterable { $rule = new PrimeNumber(); diff --git a/tests/unit/Rules/PrintableTest.php b/tests/unit/Rules/PrintableTest.php index 6a8b56c46..96bb9deb2 100644 --- a/tests/unit/Rules/PrintableTest.php +++ b/tests/unit/Rules/PrintableTest.php @@ -20,10 +20,8 @@ #[CoversClass(Printable::class)] final class PrintableTest extends RuleTestCase { - /** - * @return array - */ - public static function providerForValidInput(): array + /** @return iterable */ + public static function providerForValidInput(): iterable { $rule = new Printable(); @@ -40,10 +38,8 @@ public static function providerForValidInput(): array ]; } - /** - * @return array - */ - public static function providerForInvalidInput(): array + /** @return iterable */ + public static function providerForInvalidInput(): iterable { $rule = new Printable(); diff --git a/tests/unit/Rules/PropertyTest.php b/tests/unit/Rules/PropertyTest.php index a6d989120..064f2e7f9 100644 --- a/tests/unit/Rules/PropertyTest.php +++ b/tests/unit/Rules/PropertyTest.php @@ -21,8 +21,8 @@ #[CoversClass(Property::class)] final class PropertyTest extends RuleTestCase { - /** @return array */ - public static function providerForValidInput(): array + /** @return iterable */ + public static function providerForValidInput(): iterable { return [ 'attribute is present without extra validator' => [new Property('public'), new WithProperties()], @@ -53,8 +53,8 @@ public static function providerForValidInput(): array ]; } - /** @return array */ - public static function providerForInvalidInput(): array + /** @return iterable */ + public static function providerForInvalidInput(): iterable { return [ 'attribute is absent without extra validator' => [new Property('barr'), new WithProperties()], diff --git a/tests/unit/Rules/PublicDomainSuffixTest.php b/tests/unit/Rules/PublicDomainSuffixTest.php index 7cfcf58e4..ca9150f13 100644 --- a/tests/unit/Rules/PublicDomainSuffixTest.php +++ b/tests/unit/Rules/PublicDomainSuffixTest.php @@ -18,10 +18,8 @@ #[CoversClass(PublicDomainSuffix::class)] final class PublicDomainSuffixTest extends RuleTestCase { - /** - * @return array - */ - public static function providerForValidInput(): array + /** @return iterable */ + public static function providerForValidInput(): iterable { $rule = new PublicDomainSuffix(); @@ -32,10 +30,8 @@ public static function providerForValidInput(): array ]; } - /** - * @return array - */ - public static function providerForInvalidInput(): array + /** @return iterable */ + public static function providerForInvalidInput(): iterable { $rule = new PublicDomainSuffix(); diff --git a/tests/unit/Rules/PunctTest.php b/tests/unit/Rules/PunctTest.php index 9c9feb92b..dfd9bba7f 100644 --- a/tests/unit/Rules/PunctTest.php +++ b/tests/unit/Rules/PunctTest.php @@ -18,10 +18,8 @@ #[CoversClass(Punct::class)] final class PunctTest extends RuleTestCase { - /** - * @return array - */ - public static function providerForValidInput(): array + /** @return iterable */ + public static function providerForValidInput(): iterable { $sut = new Punct(); @@ -35,10 +33,8 @@ public static function providerForValidInput(): array ]; } - /** - * @return array - */ - public static function providerForInvalidInput(): array + /** @return iterable */ + public static function providerForInvalidInput(): iterable { $sut = new Punct(); diff --git a/tests/unit/Rules/ReadableTest.php b/tests/unit/Rules/ReadableTest.php index 6ce838ec8..5d8d9d2ca 100644 --- a/tests/unit/Rules/ReadableTest.php +++ b/tests/unit/Rules/ReadableTest.php @@ -20,10 +20,8 @@ #[CoversClass(Readable::class)] final class ReadableTest extends RuleTestCase { - /** - * @return array - */ - public static function providerForValidInput(): array + /** @return iterable */ + public static function providerForValidInput(): iterable { $file = self::fixture('valid-image.gif'); $rule = new Readable(); @@ -35,10 +33,8 @@ public static function providerForValidInput(): array ]; } - /** - * @return array - */ - public static function providerForInvalidInput(): array + /** @return iterable */ + public static function providerForInvalidInput(): iterable { $file = self::fixture('invalid-image.gif'); $rule = new Readable(); diff --git a/tests/unit/Rules/RegexTest.php b/tests/unit/Rules/RegexTest.php index 2fff5b3b4..41f0afd92 100644 --- a/tests/unit/Rules/RegexTest.php +++ b/tests/unit/Rules/RegexTest.php @@ -18,10 +18,8 @@ #[CoversClass(Regex::class)] final class RegexTest extends RuleTestCase { - /** - * @return array - */ - public static function providerForValidInput(): array + /** @return iterable */ + public static function providerForValidInput(): iterable { return [ [new Regex('/^[a-z]+$/'), 'wpoiur'], @@ -30,10 +28,8 @@ public static function providerForValidInput(): array ]; } - /** - * @return array - */ - public static function providerForInvalidInput(): array + /** @return iterable */ + public static function providerForInvalidInput(): iterable { return [ [new Regex('/^w+$/'), 'w poiur'], diff --git a/tests/unit/Rules/ResourceTypeTest.php b/tests/unit/Rules/ResourceTypeTest.php index 4cf08a6ca..152c004b3 100644 --- a/tests/unit/Rules/ResourceTypeTest.php +++ b/tests/unit/Rules/ResourceTypeTest.php @@ -21,10 +21,8 @@ #[CoversClass(ResourceType::class)] final class ResourceTypeTest extends RuleTestCase { - /** - * @return array - */ - public static function providerForValidInput(): array + /** @return iterable */ + public static function providerForValidInput(): iterable { $rule = new ResourceType(); @@ -34,10 +32,8 @@ public static function providerForValidInput(): array ]; } - /** - * @return array - */ - public static function providerForInvalidInput(): array + /** @return iterable */ + public static function providerForInvalidInput(): iterable { $rule = new ResourceType(); diff --git a/tests/unit/Rules/RomanTest.php b/tests/unit/Rules/RomanTest.php index 9360baeda..464435f14 100644 --- a/tests/unit/Rules/RomanTest.php +++ b/tests/unit/Rules/RomanTest.php @@ -17,10 +17,8 @@ #[CoversClass(Roman::class)] final class RomanTest extends RuleTestCase { - /** - * @return array - */ - public static function providerForValidInput(): array + /** @return iterable */ + public static function providerForValidInput(): iterable { $sut = new Roman(); @@ -40,10 +38,8 @@ public static function providerForValidInput(): array ]; } - /** - * @return array - */ - public static function providerForInvalidInput(): array + /** @return iterable */ + public static function providerForInvalidInput(): iterable { $sut = new Roman(); diff --git a/tests/unit/Rules/ScalarValTest.php b/tests/unit/Rules/ScalarValTest.php index cd571a3ec..6cabb29eb 100644 --- a/tests/unit/Rules/ScalarValTest.php +++ b/tests/unit/Rules/ScalarValTest.php @@ -20,10 +20,8 @@ #[CoversClass(ScalarVal::class)] final class ScalarValTest extends RuleTestCase { - /** - * @return array - */ - public static function providerForValidInput(): array + /** @return iterable */ + public static function providerForValidInput(): iterable { $rule = new ScalarVal(); @@ -37,10 +35,8 @@ public static function providerForValidInput(): array ]; } - /** - * @return array - */ - public static function providerForInvalidInput(): array + /** @return iterable */ + public static function providerForInvalidInput(): iterable { $rule = new ScalarVal(); diff --git a/tests/unit/Rules/SizeTest.php b/tests/unit/Rules/SizeTest.php index 4677704ec..6aa960fc2 100644 --- a/tests/unit/Rules/SizeTest.php +++ b/tests/unit/Rules/SizeTest.php @@ -33,10 +33,8 @@ public function shouldThrowsAnExceptionWhenSizeIsNotValid(): void new Size('42jb'); } - /** - * @return array - */ - public static function providerForValidInput(): array + /** @return iterable */ + public static function providerForValidInput(): iterable { $root = vfsStream::setup(); $file2Kb = vfsStream::newFile('2kb.txt') @@ -63,10 +61,8 @@ public static function providerForValidInput(): array ]; } - /** - * @return array - */ - public static function providerForInvalidInput(): array + /** @return iterable */ + public static function providerForInvalidInput(): iterable { $root = vfsStream::setup(); $file2Kb = vfsStream::newFile('2kb.txt') diff --git a/tests/unit/Rules/SlugTest.php b/tests/unit/Rules/SlugTest.php index 80f24d681..0e7508bcf 100644 --- a/tests/unit/Rules/SlugTest.php +++ b/tests/unit/Rules/SlugTest.php @@ -18,10 +18,8 @@ #[CoversClass(Slug::class)] final class SlugTest extends RuleTestCase { - /** - * @return array - */ - public static function providerForValidInput(): array + /** @return iterable */ + public static function providerForValidInput(): iterable { $sut = new Slug(); @@ -33,10 +31,8 @@ public static function providerForValidInput(): array ]; } - /** - * @return array - */ - public static function providerForInvalidInput(): array + /** @return iterable */ + public static function providerForInvalidInput(): iterable { $sut = new Slug(); diff --git a/tests/unit/Rules/SortedTest.php b/tests/unit/Rules/SortedTest.php index 6fecfc411..1936e6203 100644 --- a/tests/unit/Rules/SortedTest.php +++ b/tests/unit/Rules/SortedTest.php @@ -28,10 +28,8 @@ public function itShouldNotAcceptWrongSortingDirection(): void new Sorted('something'); } - /** - * @return array - */ - public static function providerForValidInput(): array + /** @return iterable */ + public static function providerForValidInput(): iterable { return [ 'empty' => [new Sorted('ASC'), []], @@ -45,10 +43,8 @@ public static function providerForValidInput(): array ]; } - /** - * @return array - */ - public static function providerForInvalidInput(): array + /** @return iterable */ + public static function providerForInvalidInput(): iterable { return [ 'duplicate' => [new Sorted('ASC'), [1, 1, 1]], diff --git a/tests/unit/Rules/SpaceTest.php b/tests/unit/Rules/SpaceTest.php index 25c80a369..50901e805 100644 --- a/tests/unit/Rules/SpaceTest.php +++ b/tests/unit/Rules/SpaceTest.php @@ -18,10 +18,8 @@ #[CoversClass(Space::class)] final class SpaceTest extends RuleTestCase { - /** - * @return array - */ - public static function providerForValidInput(): array + /** @return iterable */ + public static function providerForValidInput(): iterable { $sut = new Space(); @@ -36,10 +34,8 @@ public static function providerForValidInput(): array ]; } - /** - * @return array - */ - public static function providerForInvalidInput(): array + /** @return iterable */ + public static function providerForInvalidInput(): iterable { $sut = new Space(); diff --git a/tests/unit/Rules/StartsWithTest.php b/tests/unit/Rules/StartsWithTest.php index 4ce3a7d06..4030ecafc 100644 --- a/tests/unit/Rules/StartsWithTest.php +++ b/tests/unit/Rules/StartsWithTest.php @@ -17,10 +17,8 @@ #[CoversClass(StartsWith::class)] final class StartsWithTest extends RuleTestCase { - /** - * @return array - */ - public static function providerForValidInput(): array + /** @return iterable */ + public static function providerForValidInput(): iterable { return [ [new StartsWith('foo'), ['foo', 'bar']], @@ -32,10 +30,8 @@ public static function providerForValidInput(): array ]; } - /** - * @return array - */ - public static function providerForInvalidInput(): array + /** @return iterable */ + public static function providerForInvalidInput(): iterable { return [ [new StartsWith('foo'), ''], diff --git a/tests/unit/Rules/StringTypeTest.php b/tests/unit/Rules/StringTypeTest.php index eb948f2e8..1dfdbb504 100644 --- a/tests/unit/Rules/StringTypeTest.php +++ b/tests/unit/Rules/StringTypeTest.php @@ -18,10 +18,8 @@ #[CoversClass(StringType::class)] final class StringTypeTest extends RuleTestCase { - /** - * @return array - */ - public static function providerForValidInput(): array + /** @return iterable */ + public static function providerForValidInput(): iterable { $rule = new StringType(); @@ -31,10 +29,8 @@ public static function providerForValidInput(): array ]; } - /** - * @return array - */ - public static function providerForInvalidInput(): array + /** @return iterable */ + public static function providerForInvalidInput(): iterable { $rule = new StringType(); diff --git a/tests/unit/Rules/StringValTest.php b/tests/unit/Rules/StringValTest.php index 192eacaee..fb38c5b29 100644 --- a/tests/unit/Rules/StringValTest.php +++ b/tests/unit/Rules/StringValTest.php @@ -21,10 +21,8 @@ #[CoversClass(StringVal::class)] final class StringValTest extends RuleTestCase { - /** - * @return array - */ - public static function providerForValidInput(): array + /** @return iterable */ + public static function providerForValidInput(): iterable { $rule = new StringVal(); @@ -39,10 +37,8 @@ public static function providerForValidInput(): array ]; } - /** - * @return array - */ - public static function providerForInvalidInput(): array + /** @return iterable */ + public static function providerForInvalidInput(): iterable { $rule = new StringVal(); diff --git a/tests/unit/Rules/SubsetTest.php b/tests/unit/Rules/SubsetTest.php index 46274a6ae..4da1b3bff 100644 --- a/tests/unit/Rules/SubsetTest.php +++ b/tests/unit/Rules/SubsetTest.php @@ -17,10 +17,8 @@ #[CoversClass(Subset::class)] final class SubsetTest extends RuleTestCase { - /** - * @return array - */ - public static function providerForValidInput(): array + /** @return iterable */ + public static function providerForValidInput(): iterable { return [ [new Subset([]), []], @@ -33,10 +31,8 @@ public static function providerForValidInput(): array ]; } - /** - * @return array - */ - public static function providerForInvalidInput(): array + /** @return iterable */ + public static function providerForInvalidInput(): iterable { return [ [new Subset([]), [1]], diff --git a/tests/unit/Rules/SymbolicLinkTest.php b/tests/unit/Rules/SymbolicLinkTest.php index 9cc86e0f8..0baab25ea 100644 --- a/tests/unit/Rules/SymbolicLinkTest.php +++ b/tests/unit/Rules/SymbolicLinkTest.php @@ -21,10 +21,8 @@ #[CoversClass(SymbolicLink::class)] final class SymbolicLinkTest extends RuleTestCase { - /** - * @return array - */ - public static function providerForValidInput(): array + /** @return iterable */ + public static function providerForValidInput(): iterable { $sut = new SymbolicLink(); @@ -35,10 +33,8 @@ public static function providerForValidInput(): array ]; } - /** - * @return array - */ - public static function providerForInvalidInput(): array + /** @return iterable */ + public static function providerForInvalidInput(): iterable { $sut = new SymbolicLink(); diff --git a/tests/unit/Rules/TimeTest.php b/tests/unit/Rules/TimeTest.php index 4ebe58668..e26736009 100644 --- a/tests/unit/Rules/TimeTest.php +++ b/tests/unit/Rules/TimeTest.php @@ -42,10 +42,8 @@ public static function invalidFormatsProvider(): array ]; } - /** - * @return array - */ - public static function providerForValidInput(): array + /** @return iterable */ + public static function providerForValidInput(): iterable { return [ [new Time(), '00:00:00'], @@ -58,10 +56,8 @@ public static function providerForValidInput(): array ]; } - /** - * @return array - */ - public static function providerForInvalidInput(): array + /** @return iterable */ + public static function providerForInvalidInput(): iterable { return [ [new Time(), '00:00:60'], diff --git a/tests/unit/Rules/TldTest.php b/tests/unit/Rules/TldTest.php index 6582a2550..673e35b9c 100644 --- a/tests/unit/Rules/TldTest.php +++ b/tests/unit/Rules/TldTest.php @@ -18,10 +18,8 @@ #[CoversClass(Tld::class)] final class TldTest extends RuleTestCase { - /** - * @return array - */ - public static function providerForValidInput(): array + /** @return iterable */ + public static function providerForValidInput(): iterable { $rule = new Tld(); @@ -36,10 +34,8 @@ public static function providerForValidInput(): array ]; } - /** - * @return array - */ - public static function providerForInvalidInput(): array + /** @return iterable */ + public static function providerForInvalidInput(): iterable { $rule = new Tld(); diff --git a/tests/unit/Rules/TrueValTest.php b/tests/unit/Rules/TrueValTest.php index d0b51de99..2a1a9394c 100644 --- a/tests/unit/Rules/TrueValTest.php +++ b/tests/unit/Rules/TrueValTest.php @@ -17,10 +17,8 @@ #[CoversClass(TrueVal::class)] final class TrueValTest extends RuleTestCase { - /** - * @return array - */ - public static function providerForValidInput(): array + /** @return iterable */ + public static function providerForValidInput(): iterable { $rule = new TrueVal(); @@ -40,10 +38,8 @@ public static function providerForValidInput(): array ]; } - /** - * @return array - */ - public static function providerForInvalidInput(): array + /** @return iterable */ + public static function providerForInvalidInput(): iterable { $rule = new TrueVal(); diff --git a/tests/unit/Rules/TypeTest.php b/tests/unit/Rules/TypeTest.php index 739ec01a8..9a0ed880a 100644 --- a/tests/unit/Rules/TypeTest.php +++ b/tests/unit/Rules/TypeTest.php @@ -31,10 +31,8 @@ public function shouldThrowExceptionWhenTypeIsNotValid(): void new Type('whatever'); } - /** - * @return array - */ - public static function providerForValidInput(): array + /** @return iterable */ + public static function providerForValidInput(): iterable { return [ [new Type('array'), []], @@ -56,10 +54,8 @@ static function (): void { ]; } - /** - * @return array - */ - public static function providerForInvalidInput(): array + /** @return iterable */ + public static function providerForInvalidInput(): iterable { return [ [new Type('int'), '1'], diff --git a/tests/unit/Rules/UniqueTest.php b/tests/unit/Rules/UniqueTest.php index fcd7b73a0..cd4f650fe 100644 --- a/tests/unit/Rules/UniqueTest.php +++ b/tests/unit/Rules/UniqueTest.php @@ -17,10 +17,8 @@ #[CoversClass(Unique::class)] final class UniqueTest extends RuleTestCase { - /** - * @return array - */ - public static function providerForValidInput(): array + /** @return iterable */ + public static function providerForValidInput(): iterable { $rule = new Unique(); @@ -35,10 +33,8 @@ public static function providerForValidInput(): array ]; } - /** - * @return array - */ - public static function providerForInvalidInput(): array + /** @return iterable */ + public static function providerForInvalidInput(): iterable { $rule = new Unique(); diff --git a/tests/unit/Rules/UploadedTest.php b/tests/unit/Rules/UploadedTest.php index 411e420af..8d6764b33 100644 --- a/tests/unit/Rules/UploadedTest.php +++ b/tests/unit/Rules/UploadedTest.php @@ -26,10 +26,8 @@ final class UploadedTest extends RuleTestCase { public const UPLOADED_FILENAME = 'uploaded.ext'; - /** - * @return array - */ - public static function providerForValidInput(): array + /** @return iterable */ + public static function providerForValidInput(): iterable { $rule = new Uploaded(); @@ -40,10 +38,8 @@ public static function providerForValidInput(): array ]; } - /** - * @return array - */ - public static function providerForInvalidInput(): array + /** @return iterable */ + public static function providerForInvalidInput(): iterable { $rule = new Uploaded(); diff --git a/tests/unit/Rules/UppercaseTest.php b/tests/unit/Rules/UppercaseTest.php index c5160ce71..039a42af6 100644 --- a/tests/unit/Rules/UppercaseTest.php +++ b/tests/unit/Rules/UppercaseTest.php @@ -18,10 +18,8 @@ #[CoversClass(Uppercase::class)] final class UppercaseTest extends RuleTestCase { - /** - * @return array - */ - public static function providerForValidInput(): array + /** @return iterable */ + public static function providerForValidInput(): iterable { $rule = new Uppercase(); @@ -40,10 +38,8 @@ public static function providerForValidInput(): array ]; } - /** - * @return array - */ - public static function providerForInvalidInput(): array + /** @return iterable */ + public static function providerForInvalidInput(): iterable { $rule = new Uppercase(); diff --git a/tests/unit/Rules/UrlTest.php b/tests/unit/Rules/UrlTest.php index 45ca043e8..bdf87a24c 100644 --- a/tests/unit/Rules/UrlTest.php +++ b/tests/unit/Rules/UrlTest.php @@ -18,10 +18,8 @@ #[CoversClass(Url::class)] final class UrlTest extends RuleTestCase { - /** - * @return array - */ - public static function providerForValidInput(): array + /** @return iterable */ + public static function providerForValidInput(): iterable { $rule = new Url(); @@ -41,10 +39,8 @@ public static function providerForValidInput(): array ]; } - /** - * @return array - */ - public static function providerForInvalidInput(): array + /** @return iterable */ + public static function providerForInvalidInput(): iterable { $rule = new Url(); diff --git a/tests/unit/Rules/UuidTest.php b/tests/unit/Rules/UuidTest.php index dfe3d9fbe..849f2a862 100644 --- a/tests/unit/Rules/UuidTest.php +++ b/tests/unit/Rules/UuidTest.php @@ -61,10 +61,8 @@ public function itShouldThrowExceptionWhenVersionIsLessThanOne(): void new Uuid($version); } - /** - * @return array - */ - public static function providerForValidInput(): array + /** @return iterable */ + public static function providerForValidInput(): iterable { $sut = new Uuid(); @@ -80,10 +78,8 @@ public static function providerForValidInput(): array ]; } - /** - * @return array - */ - public static function providerForInvalidInput(): array + /** @return iterable */ + public static function providerForInvalidInput(): iterable { $sut = new Uuid(); $sutVersion1 = new Uuid(1); diff --git a/tests/unit/Rules/VersionTest.php b/tests/unit/Rules/VersionTest.php index 80f7c6eb5..d93bfa901 100644 --- a/tests/unit/Rules/VersionTest.php +++ b/tests/unit/Rules/VersionTest.php @@ -19,10 +19,8 @@ #[CoversClass(Version::class)] final class VersionTest extends RuleTestCase { - /** - * @return array - */ - public static function providerForValidInput(): array + /** @return iterable */ + public static function providerForValidInput(): iterable { $sut = new Version(); @@ -37,10 +35,8 @@ public static function providerForValidInput(): array ]; } - /** - * @return array - */ - public static function providerForInvalidInput(): array + /** @return iterable */ + public static function providerForInvalidInput(): iterable { $sut = new Version(); diff --git a/tests/unit/Rules/VideoUrlTest.php b/tests/unit/Rules/VideoUrlTest.php index 0b709ac68..ee4a2fa8e 100644 --- a/tests/unit/Rules/VideoUrlTest.php +++ b/tests/unit/Rules/VideoUrlTest.php @@ -17,10 +17,8 @@ #[CoversClass(VideoUrl::class)] final class VideoUrlTest extends RuleTestCase { - /** - * @return array - */ - public static function providerForValidInput(): array + /** @return iterable */ + public static function providerForValidInput(): iterable { return [ 'vimeo service with subdomain' => [new VideoUrl('vimeo'), 'https://player.vimeo.com/video/71787467'], @@ -38,10 +36,8 @@ public static function providerForValidInput(): array ]; } - /** - * @return array - */ - public static function providerForInvalidInput(): array + /** @return iterable */ + public static function providerForInvalidInput(): iterable { return [ 'vimeo service with youtube url' => [new VideoUrl('vimeo'), 'https://www.youtube.com/watch?v=netHLn9TScY'], diff --git a/tests/unit/Rules/VowelTest.php b/tests/unit/Rules/VowelTest.php index 7361880fc..bad3be37b 100644 --- a/tests/unit/Rules/VowelTest.php +++ b/tests/unit/Rules/VowelTest.php @@ -18,10 +18,8 @@ #[CoversClass(Vowel::class)] final class VowelTest extends RuleTestCase { - /** - * @return array - */ - public static function providerForValidInput(): array + /** @return iterable */ + public static function providerForValidInput(): iterable { $sut = new Vowel(); @@ -38,10 +36,8 @@ public static function providerForValidInput(): array ]; } - /** - * @return array - */ - public static function providerForInvalidInput(): array + /** @return iterable */ + public static function providerForInvalidInput(): iterable { $sut = new Vowel(); diff --git a/tests/unit/Rules/WhenTest.php b/tests/unit/Rules/WhenTest.php index ee821ea13..1e8eeb81f 100644 --- a/tests/unit/Rules/WhenTest.php +++ b/tests/unit/Rules/WhenTest.php @@ -18,10 +18,8 @@ #[CoversClass(When::class)] final class WhenTest extends RuleTestCase { - /** - * @return array - */ - public static function providerForValidInput(): array + /** @return iterable */ + public static function providerForValidInput(): iterable { return [ 'all true' => [ @@ -47,10 +45,8 @@ public static function providerForValidInput(): array ]; } - /** - * @return array - */ - public static function providerForInvalidInput(): array + /** @return iterable */ + public static function providerForInvalidInput(): iterable { return [ 'bool (when = true, then = false, else = false)' => [ diff --git a/tests/unit/Rules/WritableTest.php b/tests/unit/Rules/WritableTest.php index 4543f63e5..1e072e420 100644 --- a/tests/unit/Rules/WritableTest.php +++ b/tests/unit/Rules/WritableTest.php @@ -23,10 +23,8 @@ #[CoversClass(Writable::class)] final class WritableTest extends RuleTestCase { - /** - * @return array - */ - public static function providerForValidInput(): array + /** @return iterable */ + public static function providerForValidInput(): iterable { $sut = new Writable(); $filename = self::fixture('valid-image.png'); @@ -44,10 +42,8 @@ public static function providerForValidInput(): array ]; } - /** - * @return array - */ - public static function providerForInvalidInput(): array + /** @return iterable */ + public static function providerForInvalidInput(): iterable { $rule = new Writable(); $filename = self::fixture('non-writable'); diff --git a/tests/unit/Rules/XdigitTest.php b/tests/unit/Rules/XdigitTest.php index 0fb1aa177..8e5a7a393 100644 --- a/tests/unit/Rules/XdigitTest.php +++ b/tests/unit/Rules/XdigitTest.php @@ -18,10 +18,8 @@ #[CoversClass(Xdigit::class)] final class XdigitTest extends RuleTestCase { - /** - * @return array - */ - public static function providerForValidInput(): array + /** @return iterable */ + public static function providerForValidInput(): iterable { return [ [new Xdigit(), 'FFF'], @@ -35,10 +33,8 @@ public static function providerForValidInput(): array ]; } - /** - * @return array - */ - public static function providerForInvalidInput(): array + /** @return iterable */ + public static function providerForInvalidInput(): iterable { return [ [new Xdigit(), ''], diff --git a/tests/unit/Rules/YesTest.php b/tests/unit/Rules/YesTest.php index 7523f215f..9e6b8543d 100644 --- a/tests/unit/Rules/YesTest.php +++ b/tests/unit/Rules/YesTest.php @@ -79,10 +79,8 @@ public static function providerForInvalidInputWithLocale(): array ]; } - /** - * @return array - */ - public static function providerForValidInput(): array + /** @return iterable */ + public static function providerForValidInput(): iterable { $sut = new Yes(); @@ -96,10 +94,8 @@ public static function providerForValidInput(): array ]; } - /** - * @return array - */ - public static function providerForInvalidInput(): array + /** @return iterable */ + public static function providerForInvalidInput(): iterable { $sut = new Yes();