diff --git a/tests/unit/Rules/AlnumTest.php b/tests/unit/Rules/AlnumTest.php index 9e90547d..a3db6495 100644 --- a/tests/unit/Rules/AlnumTest.php +++ b/tests/unit/Rules/AlnumTest.php @@ -19,9 +19,7 @@ use stdClass; #[CoversClass(Alnum::class)] final class AlnumTest extends RuleTestCase { - /** - * @return array - */ + /** @return iterable */ public static function providerForValidInput(): iterable { return [ @@ -42,9 +40,7 @@ final class AlnumTest extends RuleTestCase ]; } - /** - * @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 cb37a7f4..2a4d720e 100644 --- a/tests/unit/Rules/AlphaTest.php +++ b/tests/unit/Rules/AlphaTest.php @@ -19,10 +19,8 @@ use stdClass; #[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 @@ final class AlphaTest extends RuleTestCase ]; } - /** - * @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 819b97b5..0ec264bf 100644 --- a/tests/unit/Rules/AlwaysInvalidTest.php +++ b/tests/unit/Rules/AlwaysInvalidTest.php @@ -31,7 +31,7 @@ final class AlwaysInvalidTest extends TestCase /** * @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 da385fe7..73535334 100644 --- a/tests/unit/Rules/AlwaysValidTest.php +++ b/tests/unit/Rules/AlwaysValidTest.php @@ -31,7 +31,7 @@ final class AlwaysValidTest extends TestCase /** * @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 43c97667..41439464 100644 --- a/tests/unit/Rules/ArrayTypeTest.php +++ b/tests/unit/Rules/ArrayTypeTest.php @@ -19,10 +19,8 @@ use Respect\Validation\Test\RuleTestCase; #[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 @@ final class ArrayTypeTest extends RuleTestCase ]; } - /** - * @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 34276cb4..fa65211f 100644 --- a/tests/unit/Rules/ArrayValTest.php +++ b/tests/unit/Rules/ArrayValTest.php @@ -20,10 +20,8 @@ use stdClass; #[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 @@ final class ArrayValTest extends RuleTestCase ]; } - /** - * @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 49823e40..362c6049 100644 --- a/tests/unit/Rules/Base64Test.php +++ b/tests/unit/Rules/Base64Test.php @@ -19,10 +19,8 @@ use function implode; #[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 @@ final class Base64Test extends RuleTestCase ]; } - /** - * @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 1af5c121..d8c744f5 100644 --- a/tests/unit/Rules/BaseTest.php +++ b/tests/unit/Rules/BaseTest.php @@ -17,10 +17,8 @@ use Respect\Validation\Test\RuleTestCase; #[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 @@ final class BaseTest extends RuleTestCase ]; } - /** - * @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 45c61b31..a5099a0d 100644 --- a/tests/unit/Rules/BetweenTest.php +++ b/tests/unit/Rules/BetweenTest.php @@ -38,10 +38,8 @@ final class BetweenTest extends RuleTestCase 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 @@ final class BetweenTest extends RuleTestCase ]; } - /** - * @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 7a42911b..51a723b7 100644 --- a/tests/unit/Rules/BoolTypeTest.php +++ b/tests/unit/Rules/BoolTypeTest.php @@ -18,10 +18,8 @@ use stdClass; #[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 @@ final class BoolTypeTest extends RuleTestCase ]; } - /** - * @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 195fd765..3e6a7a3b 100644 --- a/tests/unit/Rules/BoolValTest.php +++ b/tests/unit/Rules/BoolValTest.php @@ -17,10 +17,8 @@ use Respect\Validation\Test\RuleTestCase; #[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 @@ final class BoolValTest extends RuleTestCase ]; } - /** - * @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 2151055c..4dfbd066 100644 --- a/tests/unit/Rules/BsnTest.php +++ b/tests/unit/Rules/BsnTest.php @@ -17,10 +17,8 @@ use Respect\Validation\Test\RuleTestCase; #[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 @@ final class BsnTest extends RuleTestCase ]; } - /** - * @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 9fe6837c..34436f9d 100644 --- a/tests/unit/Rules/CallTest.php +++ b/tests/unit/Rules/CallTest.php @@ -90,16 +90,16 @@ final class CallTest extends RuleTestCase 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 65d79e40..7cccf8ef 100644 --- a/tests/unit/Rules/CallableTypeTest.php +++ b/tests/unit/Rules/CallableTypeTest.php @@ -21,10 +21,8 @@ use const INF; #[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 @@ final class CallableTypeTest extends RuleTestCase ]; } - /** - * @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 8569f766..c0032ac3 100644 --- a/tests/unit/Rules/CallbackTest.php +++ b/tests/unit/Rules/CallbackTest.php @@ -19,10 +19,8 @@ use stdClass; #[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 @@ final class CallbackTest extends RuleTestCase ]; } - /** - * @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 a9b8aed9..934a5818 100644 --- a/tests/unit/Rules/CharsetTest.php +++ b/tests/unit/Rules/CharsetTest.php @@ -30,10 +30,8 @@ final class CharsetTest extends RuleTestCase 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 @@ final class CharsetTest extends RuleTestCase ]; } - /** - * @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 f0e1ee5e..9dbffff3 100644 --- a/tests/unit/Rules/CnhTest.php +++ b/tests/unit/Rules/CnhTest.php @@ -18,10 +18,8 @@ use stdClass; #[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 @@ final class CnhTest extends RuleTestCase ]; } - /** - * @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 7b9f668e..1deed4bb 100644 --- a/tests/unit/Rules/CnpjTest.php +++ b/tests/unit/Rules/CnpjTest.php @@ -17,10 +17,8 @@ use Respect\Validation\Test\RuleTestCase; #[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 @@ final class CnpjTest extends RuleTestCase ]; } - /** - * @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 d95f66a4..0daa6d09 100644 --- a/tests/unit/Rules/ConsonantTest.php +++ b/tests/unit/Rules/ConsonantTest.php @@ -19,10 +19,8 @@ use stdClass; #[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 @@ final class ConsonantTest extends RuleTestCase ]; } - /** - * @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 4915a1c6..27e3685b 100644 --- a/tests/unit/Rules/ContainsAnyTest.php +++ b/tests/unit/Rules/ContainsAnyTest.php @@ -17,10 +17,8 @@ use Respect\Validation\Test\RuleTestCase; #[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 @@ final class ContainsAnyTest extends RuleTestCase ]; } - /** - * @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 8f21b5a7..591e06ce 100644 --- a/tests/unit/Rules/ContainsTest.php +++ b/tests/unit/Rules/ContainsTest.php @@ -17,10 +17,8 @@ use Respect\Validation\Test\RuleTestCase; #[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 @@ final class ContainsTest extends RuleTestCase ]; } - /** - * @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 da4969be..ca08eeed 100644 --- a/tests/unit/Rules/ControlTest.php +++ b/tests/unit/Rules/ControlTest.php @@ -19,10 +19,8 @@ use stdClass; #[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 @@ final class ControlTest extends RuleTestCase ]; } - /** - * @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 6276274e..f98ddf53 100644 --- a/tests/unit/Rules/CountableTest.php +++ b/tests/unit/Rules/CountableTest.php @@ -22,10 +22,8 @@ use const PHP_INT_MAX; #[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 @@ final class CountableTest extends RuleTestCase ]; } - /** - * @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 aaa6d2fd..f88e02ac 100644 --- a/tests/unit/Rules/CountryCodeTest.php +++ b/tests/unit/Rules/CountryCodeTest.php @@ -30,10 +30,8 @@ final class CountryCodeTest extends RuleTestCase 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 @@ final class CountryCodeTest extends RuleTestCase ]; } - /** - * @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 342f5eeb..a680b5b9 100644 --- a/tests/unit/Rules/CpfTest.php +++ b/tests/unit/Rules/CpfTest.php @@ -17,10 +17,8 @@ use Respect\Validation\Test\RuleTestCase; #[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 @@ final class CpfTest extends RuleTestCase ]; } - /** - * @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 5440cf10..4961ff53 100644 --- a/tests/unit/Rules/CreditCardTest.php +++ b/tests/unit/Rules/CreditCardTest.php @@ -31,10 +31,8 @@ final class CreditCardTest extends RuleTestCase 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 @@ final class CreditCardTest extends RuleTestCase ]; } - /** - * @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 38fcdef3..d6f3be86 100644 --- a/tests/unit/Rules/CurrencyCodeTest.php +++ b/tests/unit/Rules/CurrencyCodeTest.php @@ -17,10 +17,8 @@ use Respect\Validation\Test\RuleTestCase; #[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 @@ final class CurrencyCodeTest extends RuleTestCase ]; } - /** - * @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 f009b11c..d31203b1 100644 --- a/tests/unit/Rules/DateTest.php +++ b/tests/unit/Rules/DateTest.php @@ -42,10 +42,8 @@ final class DateTest extends RuleTestCase ]; } - /** - * @return array - */ - public static function providerForValidInput(): array + /** @return iterable */ + public static function providerForValidInput(): iterable { return [ [new Date(), '2017-12-31'], @@ -56,10 +54,8 @@ final class DateTest extends RuleTestCase ]; } - /** - * @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 b8fdc8bf..59b5d997 100644 --- a/tests/unit/Rules/DateTimeTest.php +++ b/tests/unit/Rules/DateTimeTest.php @@ -57,10 +57,8 @@ final class DateTimeTest extends RuleTestCase ]; } - /** - * @return array - */ - public static function providerForValidInput(): array + /** @return iterable */ + public static function providerForValidInput(): iterable { return [ [new DateTime(), 'now'], @@ -85,10 +83,8 @@ final class DateTimeTest extends RuleTestCase ]; } - /** - * @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 aa8a1df7..4bad1a94 100644 --- a/tests/unit/Rules/DecimalTest.php +++ b/tests/unit/Rules/DecimalTest.php @@ -23,10 +23,8 @@ use const NAN; #[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 @@ final class DecimalTest extends RuleTestCase ]; } - /** - * @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 9604547b..fa07d69c 100644 --- a/tests/unit/Rules/DigitTest.php +++ b/tests/unit/Rules/DigitTest.php @@ -18,10 +18,8 @@ use Respect\Validation\Test\RuleTestCase; #[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 @@ final class DigitTest extends RuleTestCase ]; } - /** - * @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 1ecfe0a7..ace4862b 100644 --- a/tests/unit/Rules/DirectoryTest.php +++ b/tests/unit/Rules/DirectoryTest.php @@ -22,10 +22,8 @@ use function dir; #[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 @@ final class DirectoryTest extends RuleTestCase ]; } - /** - * @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 d191ea10..4e5ad8ff 100644 --- a/tests/unit/Rules/DomainTest.php +++ b/tests/unit/Rules/DomainTest.php @@ -19,10 +19,8 @@ use stdClass; #[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 @@ final class DomainTest extends RuleTestCase ]; } - /** - * @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 f4dd12af..c1728553 100644 --- a/tests/unit/Rules/EachTest.php +++ b/tests/unit/Rules/EachTest.php @@ -70,10 +70,8 @@ final class EachTest extends RuleTestCase } } - /** - * @return array - */ - public static function providerForValidInput(): array + /** @return iterable */ + public static function providerForValidInput(): iterable { return [ [new Each(Stub::pass(0)), []], @@ -83,10 +81,8 @@ final class EachTest extends RuleTestCase ]; } - /** - * @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 df517aeb..fa745cd2 100644 --- a/tests/unit/Rules/EmailTest.php +++ b/tests/unit/Rules/EmailTest.php @@ -42,10 +42,8 @@ final class EmailTest extends RuleTestCase 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 @@ final class EmailTest extends RuleTestCase ]; } - /** - * @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 aaeb078a..44f34b64 100644 --- a/tests/unit/Rules/EndsWithTest.php +++ b/tests/unit/Rules/EndsWithTest.php @@ -17,10 +17,8 @@ use Respect\Validation\Test\RuleTestCase; #[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 @@ final class EndsWithTest extends RuleTestCase ]; } - /** - * @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 a0ee6cd0..3545d2e4 100644 --- a/tests/unit/Rules/EqualsTest.php +++ b/tests/unit/Rules/EqualsTest.php @@ -29,10 +29,8 @@ final class EqualsTest extends RuleTestCase 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 @@ final class EqualsTest extends RuleTestCase ]; } - /** - * @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 cbf4faa5..16564b45 100644 --- a/tests/unit/Rules/EquivalentTest.php +++ b/tests/unit/Rules/EquivalentTest.php @@ -18,10 +18,8 @@ use Respect\Validation\Test\RuleTestCase; #[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 @@ final class EquivalentTest extends RuleTestCase ]; } - /** - * @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 83d0c705..ae6b5d5a 100644 --- a/tests/unit/Rules/EvenTest.php +++ b/tests/unit/Rules/EvenTest.php @@ -19,10 +19,8 @@ use const INF; #[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 @@ final class EvenTest extends RuleTestCase ]; } - /** - * @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 97e0e847..a19db036 100644 --- a/tests/unit/Rules/ExecutableTest.php +++ b/tests/unit/Rules/ExecutableTest.php @@ -19,10 +19,8 @@ use SplFileObject; #[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 @@ final class ExecutableTest extends RuleTestCase ]; } - /** - * @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 8083a0e1..ee607c4a 100644 --- a/tests/unit/Rules/ExistsTest.php +++ b/tests/unit/Rules/ExistsTest.php @@ -19,10 +19,8 @@ use SplFileObject; #[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 @@ final class ExistsTest extends RuleTestCase ]; } - /** - * @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 adb802de..fe0399a4 100644 --- a/tests/unit/Rules/ExtensionTest.php +++ b/tests/unit/Rules/ExtensionTest.php @@ -18,10 +18,8 @@ use SplFileInfo; #[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 @@ final class ExtensionTest extends RuleTestCase ]; } - /** - * @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 e53ccb5b..2ac39e35 100644 --- a/tests/unit/Rules/FactorTest.php +++ b/tests/unit/Rules/FactorTest.php @@ -25,10 +25,8 @@ use const PHP_INT_MAX; #[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 @@ final class FactorTest extends RuleTestCase ]; } - /** - * @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 c7d6ef2f..cd56ba61 100644 --- a/tests/unit/Rules/FalseValTest.php +++ b/tests/unit/Rules/FalseValTest.php @@ -22,10 +22,8 @@ use const PHP_INT_MAX; #[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 @@ final class FalseValTest extends RuleTestCase ]; } - /** - * @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 74da0b6f..e2bf3d9a 100644 --- a/tests/unit/Rules/FibonacciTest.php +++ b/tests/unit/Rules/FibonacciTest.php @@ -17,10 +17,8 @@ use Respect\Validation\Test\RuleTestCase; #[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 @@ final class FibonacciTest extends RuleTestCase ]; } - /** - * @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 e6f001e5..fc66cdf5 100644 --- a/tests/unit/Rules/FileTest.php +++ b/tests/unit/Rules/FileTest.php @@ -22,10 +22,8 @@ use const PHP_INT_MAX; #[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 @@ final class FileTest extends RuleTestCase ]; } - /** - * @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 aed9564c..f7fb5711 100644 --- a/tests/unit/Rules/FilterVarTest.php +++ b/tests/unit/Rules/FilterVarTest.php @@ -39,10 +39,8 @@ final class FilterVarTest extends RuleTestCase 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 @@ final class FilterVarTest extends RuleTestCase ]; } - /** - * @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 c37287b6..c474fc73 100644 --- a/tests/unit/Rules/FiniteTest.php +++ b/tests/unit/Rules/FiniteTest.php @@ -23,10 +23,8 @@ use const PHP_INT_MAX; #[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 @@ final class FiniteTest extends RuleTestCase ]; } - /** - * @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 dc702bca..99945a56 100644 --- a/tests/unit/Rules/FloatTypeTest.php +++ b/tests/unit/Rules/FloatTypeTest.php @@ -19,10 +19,8 @@ use const PHP_INT_MAX; #[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 @@ final class FloatTypeTest extends RuleTestCase ]; } - /** - * @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 7a1bf8b1..149b43d9 100644 --- a/tests/unit/Rules/FloatValTest.php +++ b/tests/unit/Rules/FloatValTest.php @@ -17,10 +17,8 @@ use Respect\Validation\Test\RuleTestCase; #[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 @@ final class FloatValTest extends RuleTestCase ]; } - /** - * @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 a6df7af9..b894f491 100644 --- a/tests/unit/Rules/GraphTest.php +++ b/tests/unit/Rules/GraphTest.php @@ -18,10 +18,8 @@ use Respect\Validation\Test\RuleTestCase; #[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 @@ final class GraphTest extends RuleTestCase ]; } - /** - * @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 2630a26b..a272a3cc 100644 --- a/tests/unit/Rules/GreaterThanTest.php +++ b/tests/unit/Rules/GreaterThanTest.php @@ -19,10 +19,8 @@ use Respect\Validation\Test\Stubs\CountableStub; #[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 @@ final class GreaterThanTest extends RuleTestCase ]; } - /** - * @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 2b25a557..d920138e 100644 --- a/tests/unit/Rules/HexRgbColorTest.php +++ b/tests/unit/Rules/HexRgbColorTest.php @@ -18,10 +18,8 @@ use stdClass; #[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 @@ final class HexRgbColorTest extends RuleTestCase ]; } - /** - * @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 9a9e009f..11dff388 100644 --- a/tests/unit/Rules/IbanTest.php +++ b/tests/unit/Rules/IbanTest.php @@ -20,10 +20,8 @@ use function extension_loaded; #[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 @@ final class IbanTest extends RuleTestCase ]; } - /** - * @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 21fb9349..e76cf4d9 100644 --- a/tests/unit/Rules/IdenticalTest.php +++ b/tests/unit/Rules/IdenticalTest.php @@ -29,10 +29,8 @@ final class IdenticalTest extends RuleTestCase 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 @@ final class IdenticalTest extends RuleTestCase ]; } - /** - * @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 50bf147e..07cfef03 100644 --- a/tests/unit/Rules/ImageTest.php +++ b/tests/unit/Rules/ImageTest.php @@ -38,10 +38,8 @@ final class ImageTest extends RuleTestCase 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 @@ final class ImageTest extends RuleTestCase ]; } - /** - * @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 071065cd..9a4526d7 100644 --- a/tests/unit/Rules/ImeiTest.php +++ b/tests/unit/Rules/ImeiTest.php @@ -18,10 +18,8 @@ use stdClass; #[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 @@ final class ImeiTest extends RuleTestCase ]; } - /** - * @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 fb3e6bee..4e6f4079 100644 --- a/tests/unit/Rules/InTest.php +++ b/tests/unit/Rules/InTest.php @@ -17,10 +17,8 @@ use Respect\Validation\Test\RuleTestCase; #[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 @@ final class InTest extends RuleTestCase ]; } - /** - * @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 87d74161..bcbdd604 100644 --- a/tests/unit/Rules/InfiniteTest.php +++ b/tests/unit/Rules/InfiniteTest.php @@ -21,10 +21,8 @@ use const PHP_INT_MAX; #[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 @@ final class InfiniteTest extends RuleTestCase ]; } - /** - * @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 2b4739e8..fd2fd3c9 100644 --- a/tests/unit/Rules/InstanceTest.php +++ b/tests/unit/Rules/InstanceTest.php @@ -23,10 +23,8 @@ use Traversable; #[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 @@ final class InstanceTest extends RuleTestCase ]; } - /** - * @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 e3a6ef40..3aa4ef7f 100644 --- a/tests/unit/Rules/IntTypeTest.php +++ b/tests/unit/Rules/IntTypeTest.php @@ -19,10 +19,8 @@ use const PHP_INT_MAX; #[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 @@ final class IntTypeTest extends RuleTestCase ]; } - /** - * @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 cc4f72a8..6096c19f 100644 --- a/tests/unit/Rules/IntValTest.php +++ b/tests/unit/Rules/IntValTest.php @@ -20,10 +20,8 @@ use const PHP_INT_MAX; #[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 @@ final class IntValTest extends RuleTestCase ]; } - /** - * @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 e0a88493..454ea3af 100644 --- a/tests/unit/Rules/IpTest.php +++ b/tests/unit/Rules/IpTest.php @@ -50,10 +50,8 @@ final class IpTest extends RuleTestCase ]; } - /** - * @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 @@ final class IpTest extends RuleTestCase ]; } - /** - * @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 eb924cf3..a9b0579f 100644 --- a/tests/unit/Rules/IsbnTest.php +++ b/tests/unit/Rules/IsbnTest.php @@ -17,10 +17,8 @@ use Respect\Validation\Test\RuleTestCase; #[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 @@ final class IsbnTest extends RuleTestCase ]; } - /** - * @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 65f1e08e..c710cf08 100644 --- a/tests/unit/Rules/IterableTypeTest.php +++ b/tests/unit/Rules/IterableTypeTest.php @@ -19,10 +19,8 @@ use stdClass; #[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 @@ final class IterableTypeTest extends RuleTestCase ]; } - /** - * @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 dc35f1eb..f54f77ef 100644 --- a/tests/unit/Rules/JsonTest.php +++ b/tests/unit/Rules/JsonTest.php @@ -18,10 +18,8 @@ use stdClass; #[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 @@ final class JsonTest extends RuleTestCase ]; } - /** - * @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 ae02cdee..93e247b0 100644 --- a/tests/unit/Rules/KeyValueTest.php +++ b/tests/unit/Rules/KeyValueTest.php @@ -17,10 +17,8 @@ use Respect\Validation\Test\RuleTestCase; #[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 @@ final class KeyValueTest extends RuleTestCase ]; } - /** - * @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 586daaf1..d2eaeff3 100644 --- a/tests/unit/Rules/LanguageCodeTest.php +++ b/tests/unit/Rules/LanguageCodeTest.php @@ -28,10 +28,8 @@ final class LanguageCodeTest extends RuleTestCase 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 @@ final class LanguageCodeTest extends RuleTestCase ]; } - /** - * @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 fc5bac5d..bb4acca6 100644 --- a/tests/unit/Rules/LeapDateTest.php +++ b/tests/unit/Rules/LeapDateTest.php @@ -18,10 +18,8 @@ use Respect\Validation\Test\RuleTestCase; #[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 @@ final class LeapDateTest extends RuleTestCase ]; } - /** - * @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 690723cb..0155baf3 100644 --- a/tests/unit/Rules/LeapYearTest.php +++ b/tests/unit/Rules/LeapYearTest.php @@ -18,10 +18,8 @@ use Respect\Validation\Test\RuleTestCase; #[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 @@ final class LeapYearTest extends RuleTestCase ]; } - /** - * @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 d143873d..c48f3aee 100644 --- a/tests/unit/Rules/LengthTest.php +++ b/tests/unit/Rules/LengthTest.php @@ -32,10 +32,8 @@ final class LengthTest extends RuleTestCase 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 @@ final class LengthTest extends RuleTestCase ]; } - /** - * @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 2820c0c3..4c130366 100644 --- a/tests/unit/Rules/LessThanTest.php +++ b/tests/unit/Rules/LessThanTest.php @@ -19,10 +19,8 @@ use Respect\Validation\Test\Stubs\CountableStub; #[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 @@ final class LessThanTest extends RuleTestCase ]; } - /** - * @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 c992d087..2c920d85 100644 --- a/tests/unit/Rules/LowercaseTest.php +++ b/tests/unit/Rules/LowercaseTest.php @@ -18,10 +18,8 @@ use stdClass; #[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 @@ final class LowercaseTest extends RuleTestCase ]; } - /** - * @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 135b6990..792b9be8 100644 --- a/tests/unit/Rules/LuhnTest.php +++ b/tests/unit/Rules/LuhnTest.php @@ -18,10 +18,8 @@ use stdClass; #[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 @@ final class LuhnTest extends RuleTestCase ]; } - /** - * @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 fb6c7a7d..792b8037 100644 --- a/tests/unit/Rules/MacAddressTest.php +++ b/tests/unit/Rules/MacAddressTest.php @@ -22,10 +22,8 @@ use const PHP_INT_MAX; #[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 @@ final class MacAddressTest extends RuleTestCase ]; } - /** - * @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 0cfdf957..022308a9 100644 --- a/tests/unit/Rules/MaxAgeTest.php +++ b/tests/unit/Rules/MaxAgeTest.php @@ -24,10 +24,8 @@ use function strtotime; #[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 @@ final class MaxAgeTest extends RuleTestCase ]; } - /** - * @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 6f375f7d..2e3fdcaa 100644 --- a/tests/unit/Rules/MaxTest.php +++ b/tests/unit/Rules/MaxTest.php @@ -21,10 +21,8 @@ use Respect\Validation\Test\Stubs\CountableStub; #[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 @@ final class MaxTest extends RuleTestCase ]; } - /** - * @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 4bb8cdf4..910d5a26 100644 --- a/tests/unit/Rules/MimetypeTest.php +++ b/tests/unit/Rules/MimetypeTest.php @@ -49,10 +49,8 @@ final class MimetypeTest extends RuleTestCase 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 @@ final class MimetypeTest extends RuleTestCase ]; } - /** - * @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 219f2f8c..4763a18b 100644 --- a/tests/unit/Rules/MinAgeTest.php +++ b/tests/unit/Rules/MinAgeTest.php @@ -24,10 +24,8 @@ use function strtotime; #[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 @@ final class MinAgeTest extends RuleTestCase ]; } - /** - * @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 767823b1..dee66711 100644 --- a/tests/unit/Rules/MinTest.php +++ b/tests/unit/Rules/MinTest.php @@ -21,10 +21,8 @@ use Respect\Validation\Test\Stubs\CountableStub; #[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 @@ final class MinTest extends RuleTestCase ]; } - /** - * @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 d81c1a25..8646086f 100644 --- a/tests/unit/Rules/MultipleTest.php +++ b/tests/unit/Rules/MultipleTest.php @@ -17,10 +17,8 @@ use Respect\Validation\Test\RuleTestCase; #[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 @@ final class MultipleTest extends RuleTestCase ]; } - /** - * @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 dc29e9d6..6df9ecee 100644 --- a/tests/unit/Rules/NegativeTest.php +++ b/tests/unit/Rules/NegativeTest.php @@ -18,10 +18,8 @@ use stdClass; #[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 @@ final class NegativeTest extends RuleTestCase ]; } - /** - * @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 f2440b22..d80fde44 100644 --- a/tests/unit/Rules/NfeAccessKeyTest.php +++ b/tests/unit/Rules/NfeAccessKeyTest.php @@ -17,10 +17,8 @@ use Respect\Validation\Test\RuleTestCase; #[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 @@ final class NfeAccessKeyTest extends RuleTestCase ]; } - /** - * @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 e044c621..d8942a9f 100644 --- a/tests/unit/Rules/NifTest.php +++ b/tests/unit/Rules/NifTest.php @@ -20,10 +20,8 @@ use function stream_context_create; #[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 @@ final class NifTest extends RuleTestCase ]; } - /** - * @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 4c233320..60a30f2e 100644 --- a/tests/unit/Rules/NipTest.php +++ b/tests/unit/Rules/NipTest.php @@ -18,10 +18,8 @@ use stdClass; #[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 @@ final class NipTest extends RuleTestCase ]; } - /** - * @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 3453e429..5496f70d 100644 --- a/tests/unit/Rules/NoTest.php +++ b/tests/unit/Rules/NoTest.php @@ -76,10 +76,8 @@ final class NoTest extends RuleTestCase ]; } - /** - * @return array - */ - public static function providerForValidInput(): array + /** @return iterable */ + public static function providerForValidInput(): iterable { $sut = new No(); @@ -93,10 +91,8 @@ final class NoTest extends RuleTestCase ]; } - /** - * @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 edb05c83..751712b1 100644 --- a/tests/unit/Rules/NoWhitespaceTest.php +++ b/tests/unit/Rules/NoWhitespaceTest.php @@ -17,10 +17,8 @@ use Respect\Validation\Test\RuleTestCase; #[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 @@ final class NoWhitespaceTest extends RuleTestCase ]; } - /** - * @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 5a3e31de..ae256b47 100644 --- a/tests/unit/Rules/NotBlankTest.php +++ b/tests/unit/Rules/NotBlankTest.php @@ -18,10 +18,8 @@ use stdClass; #[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 @@ final class NotBlankTest extends RuleTestCase ]; } - /** - * @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 d99c71a3..3cb501c8 100644 --- a/tests/unit/Rules/NotEmojiTest.php +++ b/tests/unit/Rules/NotEmojiTest.php @@ -18,10 +18,8 @@ use stdClass; #[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 @@ final class NotEmojiTest extends RuleTestCase ]; } - /** - * @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 69ae0886..412d0ef9 100644 --- a/tests/unit/Rules/NotEmptyTest.php +++ b/tests/unit/Rules/NotEmptyTest.php @@ -18,10 +18,8 @@ use stdClass; #[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 @@ final class NotEmptyTest extends RuleTestCase ]; } - /** - * @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 f0dac6f9..a9a2e3cb 100644 --- a/tests/unit/Rules/NotOptionalTest.php +++ b/tests/unit/Rules/NotOptionalTest.php @@ -18,10 +18,8 @@ use stdClass; #[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 @@ final class NotOptionalTest extends RuleTestCase ]; } - /** - * @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 2e2a9d56..f28b8ad1 100644 --- a/tests/unit/Rules/NullTypeTest.php +++ b/tests/unit/Rules/NullTypeTest.php @@ -17,10 +17,8 @@ use Respect\Validation\Test\RuleTestCase; #[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 @@ final class NullTypeTest extends RuleTestCase ]; } - /** - * @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 123fd94e..9315ba12 100644 --- a/tests/unit/Rules/NumberTest.php +++ b/tests/unit/Rules/NumberTest.php @@ -25,10 +25,8 @@ use const PHP_INT_MAX; #[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 @@ final class NumberTest extends RuleTestCase ]; } - /** - * @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 08b6dbcc..5907b00c 100644 --- a/tests/unit/Rules/NumericValTest.php +++ b/tests/unit/Rules/NumericValTest.php @@ -17,10 +17,8 @@ use Respect\Validation\Test\RuleTestCase; #[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 @@ final class NumericValTest extends RuleTestCase ]; } - /** - * @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 56b796ed..7a1851a1 100644 --- a/tests/unit/Rules/ObjectTypeTest.php +++ b/tests/unit/Rules/ObjectTypeTest.php @@ -19,10 +19,8 @@ use stdClass; #[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 @@ final class ObjectTypeTest extends RuleTestCase ]; } - /** - * @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 6aa480b3..44a2d5f8 100644 --- a/tests/unit/Rules/OddTest.php +++ b/tests/unit/Rules/OddTest.php @@ -20,10 +20,8 @@ use function tmpfile; #[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 @@ final class OddTest extends RuleTestCase ]; } - /** - * @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 ceb415a4..a730dca2 100644 --- a/tests/unit/Rules/PerfectSquareTest.php +++ b/tests/unit/Rules/PerfectSquareTest.php @@ -17,10 +17,8 @@ use Respect\Validation\Test\RuleTestCase; #[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 @@ final class PerfectSquareTest extends RuleTestCase ]; } - /** - * @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 e0ff476c..6b9107bc 100644 --- a/tests/unit/Rules/PeselTest.php +++ b/tests/unit/Rules/PeselTest.php @@ -17,10 +17,8 @@ use Respect\Validation\Test\RuleTestCase; #[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 @@ final class PeselTest extends RuleTestCase ]; } - /** - * @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 cf5aa2d3..8aa5dd8c 100644 --- a/tests/unit/Rules/PhoneTest.php +++ b/tests/unit/Rules/PhoneTest.php @@ -38,10 +38,8 @@ final class PhoneTest extends RuleTestCase $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 @@ final class PhoneTest extends RuleTestCase ]; } - /** - * @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 66212a01..86dfd71c 100644 --- a/tests/unit/Rules/PhpLabelTest.php +++ b/tests/unit/Rules/PhpLabelTest.php @@ -24,10 +24,8 @@ use function uniqid; #[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 @@ final class PhpLabelTest extends RuleTestCase ]; } - /** - * @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 e5b0eccf..942c4a5a 100644 --- a/tests/unit/Rules/PisTest.php +++ b/tests/unit/Rules/PisTest.php @@ -18,10 +18,8 @@ use stdClass; #[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 @@ final class PisTest extends RuleTestCase ]; } - /** - * @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 89c5637c..326f7cb5 100644 --- a/tests/unit/Rules/PolishIdCardTest.php +++ b/tests/unit/Rules/PolishIdCardTest.php @@ -17,10 +17,8 @@ use Respect\Validation\Test\RuleTestCase; #[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 @@ final class PolishIdCardTest extends RuleTestCase ]; } - /** - * @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 090d163e..c1fb4d80 100644 --- a/tests/unit/Rules/PortugueseNifTest.php +++ b/tests/unit/Rules/PortugueseNifTest.php @@ -16,10 +16,8 @@ use function stream_context_create; 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 @@ final class PortugueseNifTest extends RuleTestCase ]; } - /** - * @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 c69b88cb..962d48b9 100644 --- a/tests/unit/Rules/PositiveTest.php +++ b/tests/unit/Rules/PositiveTest.php @@ -18,10 +18,8 @@ use stdClass; #[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 @@ final class PositiveTest extends RuleTestCase ]; } - /** - * @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 8aa922e7..51ba17c1 100644 --- a/tests/unit/Rules/PostalCodeTest.php +++ b/tests/unit/Rules/PostalCodeTest.php @@ -44,10 +44,8 @@ final class PostalCodeTest extends RuleTestCase 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 @@ final class PostalCodeTest extends RuleTestCase ]; } - /** - * @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 36e374af..a7c82dbd 100644 --- a/tests/unit/Rules/PrimeNumberTest.php +++ b/tests/unit/Rules/PrimeNumberTest.php @@ -17,10 +17,8 @@ use Respect\Validation\Test\RuleTestCase; #[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 @@ final class PrimeNumberTest extends RuleTestCase ]; } - /** - * @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 6a8b56c4..96bb9deb 100644 --- a/tests/unit/Rules/PrintableTest.php +++ b/tests/unit/Rules/PrintableTest.php @@ -20,10 +20,8 @@ use function chr; #[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 @@ final class PrintableTest extends RuleTestCase ]; } - /** - * @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 a6d98912..064f2e7f 100644 --- a/tests/unit/Rules/PropertyTest.php +++ b/tests/unit/Rules/PropertyTest.php @@ -21,8 +21,8 @@ use Respect\Validation\Test\Stubs\WithUninitialized; #[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 @@ final class PropertyTest extends RuleTestCase ]; } - /** @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 7cfcf58e..ca9150f1 100644 --- a/tests/unit/Rules/PublicDomainSuffixTest.php +++ b/tests/unit/Rules/PublicDomainSuffixTest.php @@ -18,10 +18,8 @@ use stdClass; #[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 @@ final class PublicDomainSuffixTest extends RuleTestCase ]; } - /** - * @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 9c9feb92..dfd9bba7 100644 --- a/tests/unit/Rules/PunctTest.php +++ b/tests/unit/Rules/PunctTest.php @@ -18,10 +18,8 @@ use Respect\Validation\Test\RuleTestCase; #[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 @@ final class PunctTest extends RuleTestCase ]; } - /** - * @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 6ce838ec..5d8d9d2c 100644 --- a/tests/unit/Rules/ReadableTest.php +++ b/tests/unit/Rules/ReadableTest.php @@ -20,10 +20,8 @@ use stdClass; #[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 @@ final class ReadableTest extends RuleTestCase ]; } - /** - * @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 2fff5b3b..41f0afd9 100644 --- a/tests/unit/Rules/RegexTest.php +++ b/tests/unit/Rules/RegexTest.php @@ -18,10 +18,8 @@ use stdClass; #[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 @@ final class RegexTest extends RuleTestCase ]; } - /** - * @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 4cf08a6c..152c004b 100644 --- a/tests/unit/Rules/ResourceTypeTest.php +++ b/tests/unit/Rules/ResourceTypeTest.php @@ -21,10 +21,8 @@ use function tmpfile; #[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 @@ final class ResourceTypeTest extends RuleTestCase ]; } - /** - * @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 9360baed..464435f1 100644 --- a/tests/unit/Rules/RomanTest.php +++ b/tests/unit/Rules/RomanTest.php @@ -17,10 +17,8 @@ use Respect\Validation\Test\RuleTestCase; #[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 @@ final class RomanTest extends RuleTestCase ]; } - /** - * @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 cd571a3e..6cabb29e 100644 --- a/tests/unit/Rules/ScalarValTest.php +++ b/tests/unit/Rules/ScalarValTest.php @@ -20,10 +20,8 @@ use function tmpfile; #[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 @@ final class ScalarValTest extends RuleTestCase ]; } - /** - * @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 4677704e..6aa960fc 100644 --- a/tests/unit/Rules/SizeTest.php +++ b/tests/unit/Rules/SizeTest.php @@ -33,10 +33,8 @@ final class SizeTest extends RuleTestCase 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 @@ final class SizeTest extends RuleTestCase ]; } - /** - * @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 80f24d68..0e7508bc 100644 --- a/tests/unit/Rules/SlugTest.php +++ b/tests/unit/Rules/SlugTest.php @@ -18,10 +18,8 @@ use stdClass; #[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 @@ final class SlugTest extends RuleTestCase ]; } - /** - * @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 6fecfc41..1936e620 100644 --- a/tests/unit/Rules/SortedTest.php +++ b/tests/unit/Rules/SortedTest.php @@ -28,10 +28,8 @@ final class SortedTest extends RuleTestCase 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 @@ final class SortedTest extends RuleTestCase ]; } - /** - * @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 25c80a36..50901e80 100644 --- a/tests/unit/Rules/SpaceTest.php +++ b/tests/unit/Rules/SpaceTest.php @@ -18,10 +18,8 @@ use Respect\Validation\Test\RuleTestCase; #[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 @@ final class SpaceTest extends RuleTestCase ]; } - /** - * @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 4ce3a7d0..4030ecaf 100644 --- a/tests/unit/Rules/StartsWithTest.php +++ b/tests/unit/Rules/StartsWithTest.php @@ -17,10 +17,8 @@ use Respect\Validation\Test\RuleTestCase; #[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 @@ final class StartsWithTest extends RuleTestCase ]; } - /** - * @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 eb948f2e..1dfdbb50 100644 --- a/tests/unit/Rules/StringTypeTest.php +++ b/tests/unit/Rules/StringTypeTest.php @@ -18,10 +18,8 @@ use stdClass; #[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 @@ final class StringTypeTest extends RuleTestCase ]; } - /** - * @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 192eacae..fb38c5b2 100644 --- a/tests/unit/Rules/StringValTest.php +++ b/tests/unit/Rules/StringValTest.php @@ -21,10 +21,8 @@ use function tmpfile; #[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 @@ final class StringValTest extends RuleTestCase ]; } - /** - * @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 46274a6a..4da1b3bf 100644 --- a/tests/unit/Rules/SubsetTest.php +++ b/tests/unit/Rules/SubsetTest.php @@ -17,10 +17,8 @@ use Respect\Validation\Test\RuleTestCase; #[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 @@ final class SubsetTest extends RuleTestCase ]; } - /** - * @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 9cc86e0f..0baab25e 100644 --- a/tests/unit/Rules/SymbolicLinkTest.php +++ b/tests/unit/Rules/SymbolicLinkTest.php @@ -21,10 +21,8 @@ use function tmpfile; #[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 @@ final class SymbolicLinkTest extends RuleTestCase ]; } - /** - * @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 4ebe5866..e2673600 100644 --- a/tests/unit/Rules/TimeTest.php +++ b/tests/unit/Rules/TimeTest.php @@ -42,10 +42,8 @@ final class TimeTest extends RuleTestCase ]; } - /** - * @return array - */ - public static function providerForValidInput(): array + /** @return iterable */ + public static function providerForValidInput(): iterable { return [ [new Time(), '00:00:00'], @@ -58,10 +56,8 @@ final class TimeTest extends RuleTestCase ]; } - /** - * @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 6582a255..673e35b9 100644 --- a/tests/unit/Rules/TldTest.php +++ b/tests/unit/Rules/TldTest.php @@ -18,10 +18,8 @@ use stdClass; #[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 @@ final class TldTest extends RuleTestCase ]; } - /** - * @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 d0b51de9..2a1a9394 100644 --- a/tests/unit/Rules/TrueValTest.php +++ b/tests/unit/Rules/TrueValTest.php @@ -17,10 +17,8 @@ use Respect\Validation\Test\RuleTestCase; #[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 @@ final class TrueValTest extends RuleTestCase ]; } - /** - * @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 739ec01a..9a0ed880 100644 --- a/tests/unit/Rules/TypeTest.php +++ b/tests/unit/Rules/TypeTest.php @@ -31,10 +31,8 @@ final class TypeTest extends RuleTestCase 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 @@ final class TypeTest extends RuleTestCase ]; } - /** - * @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 fcd7b73a..cd4f650f 100644 --- a/tests/unit/Rules/UniqueTest.php +++ b/tests/unit/Rules/UniqueTest.php @@ -17,10 +17,8 @@ use Respect\Validation\Test\RuleTestCase; #[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 @@ final class UniqueTest extends RuleTestCase ]; } - /** - * @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 411e420a..8d6764b3 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 @@ final class UploadedTest extends RuleTestCase ]; } - /** - * @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 c5160ce7..039a42af 100644 --- a/tests/unit/Rules/UppercaseTest.php +++ b/tests/unit/Rules/UppercaseTest.php @@ -18,10 +18,8 @@ use stdClass; #[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 @@ final class UppercaseTest extends RuleTestCase ]; } - /** - * @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 45ca043e..bdf87a24 100644 --- a/tests/unit/Rules/UrlTest.php +++ b/tests/unit/Rules/UrlTest.php @@ -18,10 +18,8 @@ use Respect\Validation\Test\RuleTestCase; #[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 @@ final class UrlTest extends RuleTestCase ]; } - /** - * @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 dfe3d9fb..849f2a86 100644 --- a/tests/unit/Rules/UuidTest.php +++ b/tests/unit/Rules/UuidTest.php @@ -61,10 +61,8 @@ final class UuidTest extends RuleTestCase new Uuid($version); } - /** - * @return array - */ - public static function providerForValidInput(): array + /** @return iterable */ + public static function providerForValidInput(): iterable { $sut = new Uuid(); @@ -80,10 +78,8 @@ final class UuidTest extends RuleTestCase ]; } - /** - * @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 80f7c6eb..d93bfa90 100644 --- a/tests/unit/Rules/VersionTest.php +++ b/tests/unit/Rules/VersionTest.php @@ -19,10 +19,8 @@ use function uniqid; #[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 @@ final class VersionTest extends RuleTestCase ]; } - /** - * @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 0b709ac6..ee4a2fa8 100644 --- a/tests/unit/Rules/VideoUrlTest.php +++ b/tests/unit/Rules/VideoUrlTest.php @@ -17,10 +17,8 @@ use Respect\Validation\Test\RuleTestCase; #[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 @@ final class VideoUrlTest extends RuleTestCase ]; } - /** - * @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 7361880f..bad3be37 100644 --- a/tests/unit/Rules/VowelTest.php +++ b/tests/unit/Rules/VowelTest.php @@ -18,10 +18,8 @@ use Respect\Validation\Test\RuleTestCase; #[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 @@ final class VowelTest extends RuleTestCase ]; } - /** - * @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 ee821ea1..1e8eeb81 100644 --- a/tests/unit/Rules/WhenTest.php +++ b/tests/unit/Rules/WhenTest.php @@ -18,10 +18,8 @@ use Respect\Validation\Test\RuleTestCase; #[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 @@ final class WhenTest extends RuleTestCase ]; } - /** - * @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 4543f63e..1e072e42 100644 --- a/tests/unit/Rules/WritableTest.php +++ b/tests/unit/Rules/WritableTest.php @@ -23,10 +23,8 @@ use function chmod; #[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 @@ final class WritableTest extends RuleTestCase ]; } - /** - * @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 0fb1aa17..8e5a7a39 100644 --- a/tests/unit/Rules/XdigitTest.php +++ b/tests/unit/Rules/XdigitTest.php @@ -18,10 +18,8 @@ use Respect\Validation\Test\RuleTestCase; #[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 @@ final class XdigitTest extends RuleTestCase ]; } - /** - * @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 7523f215..9e6b8543 100644 --- a/tests/unit/Rules/YesTest.php +++ b/tests/unit/Rules/YesTest.php @@ -79,10 +79,8 @@ final class YesTest extends RuleTestCase ]; } - /** - * @return array - */ - public static function providerForValidInput(): array + /** @return iterable */ + public static function providerForValidInput(): iterable { $sut = new Yes(); @@ -96,10 +94,8 @@ final class YesTest extends RuleTestCase ]; } - /** - * @return array - */ - public static function providerForInvalidInput(): array + /** @return iterable */ + public static function providerForInvalidInput(): iterable { $sut = new Yes();