From d3ebd02cb13f6aa6e78a7f328028c74ba0945ea7 Mon Sep 17 00:00:00 2001 From: Sylvain Fabre Date: Fri, 13 Feb 2026 15:49:46 +0100 Subject: [PATCH] Apply Rector fixes: make data providers static Co-Authored-By: Claude Opus 4.6 --- tests/Resolver/BounceTypeResolverTest.php | 2 +- tests/Resolver/ProviderResolverTest.php | 2 +- .../BounceIsCausedByInactiveUserSpecificationTest.php | 2 +- .../BounceIsCausedByOverQuotaSpecificationTest.php | 2 +- .../BounceIsCausedByUnknownUserSpecificationTest.php | 2 +- tests/Specification/BounceIsSpamRelatedSpecificationTest.php | 2 +- tests/Specification/BounceReasonIsUnknownSpecificationTest.php | 2 +- .../EmailAddressIsFromACountrySpecificationTest.php | 2 +- .../EmailAddressIsFromAProviderSpecificationTest.php | 2 +- tests/Translatable/BounceReasonTranslatableTest.php | 2 +- tests/Validation/SmtpValidatorTest.php | 2 +- 11 files changed, 11 insertions(+), 11 deletions(-) diff --git a/tests/Resolver/BounceTypeResolverTest.php b/tests/Resolver/BounceTypeResolverTest.php index 27b098a..d364039 100644 --- a/tests/Resolver/BounceTypeResolverTest.php +++ b/tests/Resolver/BounceTypeResolverTest.php @@ -17,7 +17,7 @@ public function testResolveBounceMessagesCorrectly(string $expected, string $bou self::assertEquals($expected, $resolver->resolve($bounceReason)); } - public function provideBounceReasons(): iterable + public static function provideBounceReasons(): iterable { yield 'DMarc failure' => [BounceTypeResolver::BOUNCE_REASON_DMARC_FAILURE, 'Email rejected per DMARC policy']; yield 'Blacklisted' => [BounceTypeResolver::BOUNCE_REASON_BLACKLISTED, 'LPN007_510']; diff --git a/tests/Resolver/ProviderResolverTest.php b/tests/Resolver/ProviderResolverTest.php index f0765aa..b0f88cf 100644 --- a/tests/Resolver/ProviderResolverTest.php +++ b/tests/Resolver/ProviderResolverTest.php @@ -22,7 +22,7 @@ public function testProviderResolverReturnsTheRightProvider(string $address, ?st self::assertSame($provider, $resolver->resolve($address)); } - public function provideAddressesAndProviders(): iterable + public static function provideAddressesAndProviders(): iterable { // Without DNS check yield ['john@hotmail.com', 'microsoft']; diff --git a/tests/Specification/BounceIsCausedByInactiveUserSpecificationTest.php b/tests/Specification/BounceIsCausedByInactiveUserSpecificationTest.php index df2ea51..5bbeedf 100644 --- a/tests/Specification/BounceIsCausedByInactiveUserSpecificationTest.php +++ b/tests/Specification/BounceIsCausedByInactiveUserSpecificationTest.php @@ -17,7 +17,7 @@ public function testSpecificationWorks(string $message, bool $isSpam): void } /** @return array{string, bool}[] */ - public function provideMessages(): iterable + public static function provideMessages(): iterable { yield ['Email rejected per SPAM policy', false]; yield [ diff --git a/tests/Specification/BounceIsCausedByOverQuotaSpecificationTest.php b/tests/Specification/BounceIsCausedByOverQuotaSpecificationTest.php index b11cbbc..94dc64a 100644 --- a/tests/Specification/BounceIsCausedByOverQuotaSpecificationTest.php +++ b/tests/Specification/BounceIsCausedByOverQuotaSpecificationTest.php @@ -17,7 +17,7 @@ public function testSpecificationWorks(string $message, bool $isSpam): void } /** @return array{string, bool}[] */ - public function provideMessages(): iterable + public static function provideMessages(): iterable { yield ['Email rejected per SPAM policy', false]; yield [ diff --git a/tests/Specification/BounceIsCausedByUnknownUserSpecificationTest.php b/tests/Specification/BounceIsCausedByUnknownUserSpecificationTest.php index 1e95b5b..57c71c5 100644 --- a/tests/Specification/BounceIsCausedByUnknownUserSpecificationTest.php +++ b/tests/Specification/BounceIsCausedByUnknownUserSpecificationTest.php @@ -17,7 +17,7 @@ public function testSpecificationWorks(string $message, bool $isSpam): void } /** @return array{string, bool}[] */ - public function provideMessages(): iterable + public static function provideMessages(): iterable { yield ['Email rejected per SPAM policy', false]; yield ['Sender address rejected: Sender user unknown. Adresse expediteur inconnue', true]; diff --git a/tests/Specification/BounceIsSpamRelatedSpecificationTest.php b/tests/Specification/BounceIsSpamRelatedSpecificationTest.php index 47fb273..923d9db 100644 --- a/tests/Specification/BounceIsSpamRelatedSpecificationTest.php +++ b/tests/Specification/BounceIsSpamRelatedSpecificationTest.php @@ -18,7 +18,7 @@ public function testSpecificationWorks(string $message, bool $isSpam): void } /** @return array{string, bool}[] */ - public function provideMessages(): iterable + public static function provideMessages(): iterable { yield ['Email rejected per SPAM policy', true]; yield ['Sender address rejected: Sender user unknown. Adresse expediteur inconnue', false]; diff --git a/tests/Specification/BounceReasonIsUnknownSpecificationTest.php b/tests/Specification/BounceReasonIsUnknownSpecificationTest.php index 1756bbf..c47373f 100644 --- a/tests/Specification/BounceReasonIsUnknownSpecificationTest.php +++ b/tests/Specification/BounceReasonIsUnknownSpecificationTest.php @@ -17,7 +17,7 @@ public function testSpecificationWorks(string $message, bool $isSpam): void } /** @return array{string, bool}[] */ - public function provideMessages(): iterable + public static function provideMessages(): iterable { yield ['hard bounce', true]; yield ['Sender address rejected: Sender user unknown. Adresse expediteur inconnue', false]; diff --git a/tests/Specification/EmailAddressIsFromACountrySpecificationTest.php b/tests/Specification/EmailAddressIsFromACountrySpecificationTest.php index 7ed8e18..aeabce0 100644 --- a/tests/Specification/EmailAddressIsFromACountrySpecificationTest.php +++ b/tests/Specification/EmailAddressIsFromACountrySpecificationTest.php @@ -22,7 +22,7 @@ public function testSpecificationWorks(string $emailAddress, string $country, bo self::assertSame($isSatisfiedBy, $spec->isSatisfiedBy($emailAddress, $country)); } - public function provideEmailAddresses(): iterable + public static function provideEmailAddresses(): iterable { // Invalid yield ['hello', 'FR', false]; diff --git a/tests/Specification/EmailAddressIsFromAProviderSpecificationTest.php b/tests/Specification/EmailAddressIsFromAProviderSpecificationTest.php index 4809834..97d79b1 100644 --- a/tests/Specification/EmailAddressIsFromAProviderSpecificationTest.php +++ b/tests/Specification/EmailAddressIsFromAProviderSpecificationTest.php @@ -19,7 +19,7 @@ public function testSpecificationWorks(string $emailAddress, string $providerNam self::assertSame($isSatisfiedBy, $spec->isSatisfiedBy($emailAddress, $providerName, true)); } - public function provideEmailAddresses(): iterable + public static function provideEmailAddresses(): iterable { yield ['invalid email', '', false]; yield ['unknow provider', 'provider that does not exist', false]; diff --git a/tests/Translatable/BounceReasonTranslatableTest.php b/tests/Translatable/BounceReasonTranslatableTest.php index 8626c3f..c0ce92e 100644 --- a/tests/Translatable/BounceReasonTranslatableTest.php +++ b/tests/Translatable/BounceReasonTranslatableTest.php @@ -26,7 +26,7 @@ public function testBounceReasonTranslatable(string $reason, string $expectedTra /** * @return iterable */ - public function providerTrans(): iterable + public static function providerTrans(): iterable { yield 'code' => [ '2.2.1 test code', diff --git a/tests/Validation/SmtpValidatorTest.php b/tests/Validation/SmtpValidatorTest.php index 78278c1..c85f32e 100644 --- a/tests/Validation/SmtpValidatorTest.php +++ b/tests/Validation/SmtpValidatorTest.php @@ -49,7 +49,7 @@ public function testClientWorks(string $email, string $expectedDtoClass): void } /** @return array{0: string, 1: class-string}[] */ - public function provideEmailAddresses(): iterable + public static function provideEmailAddresses(): iterable { yield ['this_user_does_not_exist', InvalidAddressDto::class]; yield ['this_user_does_not_exist@this_domain_does_not_exist', InvalidAddressDto::class];