Skip to content

chore(deps): update dependency rector/rector to v2.5.7#455

Merged
renovate[bot] merged 1 commit into
mainfrom
renovate/rector-rector-2.x
Jul 14, 2026
Merged

chore(deps): update dependency rector/rector to v2.5.7#455
renovate[bot] merged 1 commit into
mainfrom
renovate/rector-rector-2.x

Conversation

@renovate

@renovate renovate Bot commented Jun 20, 2026

Copy link
Copy Markdown
Contributor

This PR contains the following updates:

Package Change Age Confidence
rector/rector (source) 2.5.42.5.7 age confidence

Warning

Some dependencies could not be looked up. Check the Dependency Dashboard for more information.


Release Notes

rectorphp/rector (rector/rector)

v2.5.7: Released Rector 2.5.7

Compare Source

This release sharpens the PHPUnit code-quality sets, adds a focused narrow asserts set, deprecates two blurry Symfony web-test rules, and fixes a handful of docblock false-positives in dead-code removal.

New Features 🎉

PHPUnit: PHPUNIT_NARROW_ASSERTS set

A new set focused on narrowing broad asserts to their specific, more descriptive method — e.g. assertTrue(isset($a['b']))assertArrayHasKey('b', $a). (rector-phpunit #​716)

use Rector\PHPUnit\Set\PHPUnitSetList;

return RectorConfig::configure()
    ->withSets([PHPUnitSetList::PHPUNIT_NARROW_ASSERTS]);

withPreparedSets() gains phpunitNarrowAsserts + phpunitMockToStub

The 2 PHPUnit sets are now toggleable like any other prepared set. (#​8178)

return RectorConfig::configure()
    ->withPreparedSets(
        phpunitNarrowAsserts: true,
        phpunitMockToStub: true,
    );

PHPUnit: flip with($this->callback(...)) on void methods to willReturnCallback()

VoidMethodWithCallbackToWillReturnCallbackRector (renamed + refocused) drops the pointless return value and types the closure as void, matching the mocked void method. (rector-phpunit #​724)

 $this->createMock(SomeClass::class)
     ->method('run')
-    ->with($this->callback(function ($arg) {
-        echo $arg;
-
-        return true;
-    }));
+    ->willReturnCallback(function ($arg): void {
+        echo $arg;
+    });
Console: -v as alias for --version

Since the verbose option was removed, -v now prints the version. (#​8177)

vendor/bin/rector -v

# Rector 2.x.x

Improvements 🔧

  • [StaticTypeMapper] Map phpstan-special scalar types (literal-string, numeric-string, …) to their real PHPStan types instead of a bogus ObjectType, so precise docblocks survive dead-code cleanup (#​8176)
  • [PHPUnit CodeQuality] Verify assert method name exists on the Assert class via reflection before transforming (rector-phpunit #​720)
  • [PHPUnit CodeQuality] Simplify single-statement void callback in CallbackSingleAssertToSimplerRector (rector-phpunit #​722)
  • [PHPUnit CodeQuality] Collapse all instanceof asserts for multiple nullable instances in a single run (rector-phpunit #​721)
  • [PHPUnit CodeQuality] Use atLeast() instead of exactly() in DecorateWillReturnMapWithExpectsMockRector (rector-phpunit #​719)

Bug Fixes 🐛

  • [DeadCode] Preserve generic @return tags in RemoveReturnTagIncompatibleWithNativeTypeRector (#​8183)
  • [DeadCode] Skip templated type in RemoveReturnTagIncompatibleWithNativeTypeRector (#​8180)
  • [DeadCode] Skip PHPStan type alias in RemoveReturnTagIncompatibleWithNativeTypeRector (#​8179)
  • [CodeQuality] Skip abstract class in CompleteDynamicPropertiesRector (#​8182)
  • [Php71] Skip magic @method in RemoveExtraParametersRector (#​8181)
  • [PHPUnit] Skip with() multiple arguments in VoidMethodWithCallbackToWillReturnCallbackRector (rector-phpunit #​725)
  • [PHPUnit] Skip new object instances in NarrowIdenticalWithConsecutiveRector — each new is a fresh instance, collapsing them changes intent (rector-phpunit #​726)
  • [PHPUnit] Skip mock property removal when used in a trait (rector-phpunit #​723)
  • [PHPUnit] Skip nested value compare in CallbackSingleAssertToSimplerRector (rector-phpunit #​718)
  • [PHPUnit] Skip union types in AssertEqualsToSameRector to preserve loose comparison (rector-phpunit #​717)

Deprecations 💀

Symfony: WebTestCaseAssertIsSuccessfulRector + WebTestCaseAssertResponseCodeRector

Both rules hide the asserted behavior and force a different assert method per status code, splitting one clear assertion into several implicit ones. Asserting the HTTP status code directly is clearer and uniform. (rector-symfony #​958)


v2.5.6: Released Rector 2.5.6

Compare Source

New Features 🥳

  • [DeadCode] Add RemoveReturnTagIncompatibleWithNativeTypeRector (#​8172)
 final class SomeClass
 {
-    /**
-     * @​return SomeObject
-     */
     public function getName(): string
     {
         return $this->someObject->getName();
     }
 }
  • [TypeDeclarationDocblocks] Add MergePhpstanDocTagIntoNativeRector to merge @phpstan-* doc tags into native tags (#​8171)
 final class SomeClass
 {
     /**
-     * @​var Collection
-     *
-     * @&#8203;phpstan-var Collection<int, string>
+     * @&#8203;var Collection<int, string>
      */
     private $items;
 }

Bugfixes 🐛


PHPUnit 🧪

New rules and changes from rector-phpunit.

New Rules
  • [CodeQuality] Add AssertClassToThisAssertRector (#​707)
 use PHPUnit\Framework\Assert;
 use PHPUnit\Framework\TestCase;

 final class SomeClass extends TestCase
 {
     public function run()
     {
-        Assert::assertEquals('expected', $result);
+        $this->assertEquals('expected', $result);
     }
 }
  • [CodeQuality] Add BareCreateMockAssignToDirectUseRector — inline a single-use createMock() assignment (#​708)
 final class SomeTest extends TestCase
 {
     public function test()
     {
-        $someObject = $this->createMock(SomeClass::class);
-        $this->process($someObject);
+        $this->process($this->createMock(SomeClass::class));
     }

     private function process(SomeClass $someObject): void
     {
     }
 }
  • [CodeQuality] Add WillReturnCallbackFallbackToThrowRector — throw on an unexpected extra consecutive call (#​710)
         $this->someServiceMock->expects($matcher)
             ->method('run')
             ->willReturnCallback(function () use ($matcher) {
                 if ($matcher->numberOfInvocations() === 1) {
                     return 1;
                 }
+
+                throw new \PHPUnit\Framework\Exception(sprintf('Method should not be called for the %dth time', $matcher->numberOfInvocations()));
             });
  • [CodeQuality] Add RemoveReturnFromVoidMethodMockCallbackRector — type a void mock callback and drop its value return (#​711)
         $this->createMock(SomeClass::class)
             ->method('run')
-            ->willReturnCallback(function ($arg) {
+            ->willReturnCallback(function ($arg): void {
                 echo $arg;
-
-                return true;
             });

(SomeClass::run() returns void.)

  • [CodeQuality] Add CallbackSingleAssertToSimplerRector — collapse a with() callback with a sole assertSame() to equalTo() (#​714)
         $builder->expects($this->exactly(2))
             ->method('add')
-            ->with($this->callback(function ($type): bool {
-                $this->assertSame(TextType::class, $type);
-
-                return true;
-            }));
+            ->with($this->equalTo(TextType::class));
Improvements
  • [CodeQuality] Skip TestCase suffix classes in RemoveNeverUsedMockPropertyRector (#​709)
  • [CodeQuality] Produce void callbacks with bare return in WithCallbackIdenticalToStandaloneAssertsRector (#​712)
  • [CodeQuality] Handle return throw and return null in void mock callbacks (#​713)

v2.5.5: Released Rector 2.5.5

Compare Source

New Features 🥳

  • [CodingStyle] Add AlternativeIfToBracketRector (#​8158)
  • [TypeDeclaration] Add PrivateMethodReturnTypeFromStrictNewArrayRector, split private methods out (#​8153)
  • [CodeQuality] Decopule array and object variants from ExplicitBoolCompareRector (#​8162)

Bugfixes 🐛

  • [TypeDeclaration] Fix AddClosureParamTypeForArrayMapRector to type closure params from array values, not keys (#​8163)
  • [Php56] Add missing parentheses for lower-precedence operands in PowToExpRector (#​8161)
  • [Php80] Keep trailing doc comment after annotation in AnnotationToAttributeRector (#​8160)
  • [CodeQuality] Skip same boolean in both branches in SimplifyIfReturnBoolRector (#​8159)
  • [CodeQuality] Skip alternative syntax (if/endif) in ShortenElseIfRector (#​8157)
  • [EarlyReturn] Split nested && operand into its own early return in ReturnBinaryOrToEarlyReturnRector (#​8156)
  • [CodeQuality] Preserve parentheses around low-precedence operands in LogicalToBooleanRector (#​8155)
  • [CodeQuality] Skip inner function referenced as string callable in InnerFunctionToPrivateMethodRector (#​8154)
  • [CodeQuality] Preserve parentheses around right-side assign in LogicalToBooleanRector (#​8152)
  • [CodeQuality] Wrap assign on right side of binary op in parentheses in LogicalToBooleanRector (#​8151)
  • [DeadCode] Keep generic static union docblock in RemoveDuplicatedReturnSelfDocblockRector (#​8150)

Configuration

📅 Schedule: (UTC)

  • Branch creation
    • Only on Sunday and Saturday (* * * * 0,6)
  • Automerge
    • At any time (no schedule defined)

🚦 Automerge: Enabled.

Rebasing: Whenever PR is behind base branch, or you tick the rebase/retry checkbox.

🔕 Ignore: Close this PR and you won't be reminded about this update again.


  • If you want to rebase/retry this PR, check this box

This PR was generated by Mend Renovate. View the repository job log.

@renovate renovate Bot force-pushed the renovate/rector-rector-2.x branch 3 times, most recently from 90d3aeb to 6d31bb7 Compare June 20, 2026 18:06
@renovate renovate Bot changed the title chore(deps): update dependency rector/rector to v2.4.6 chore(deps): update dependency rector/rector to v2.5.0 Jun 20, 2026
@renovate renovate Bot force-pushed the renovate/rector-rector-2.x branch from 6d31bb7 to 130b2ee Compare June 21, 2026 13:27
@renovate renovate Bot changed the title chore(deps): update dependency rector/rector to v2.5.0 chore(deps): update dependency rector/rector to v2.5.1 Jun 21, 2026
@renovate renovate Bot force-pushed the renovate/rector-rector-2.x branch from 130b2ee to a3a29a9 Compare June 22, 2026 18:59
@renovate renovate Bot changed the title chore(deps): update dependency rector/rector to v2.5.1 chore(deps): update dependency rector/rector to v2.5.2 Jun 22, 2026
@renovate renovate Bot force-pushed the renovate/rector-rector-2.x branch 5 times, most recently from ded2787 to 6714d86 Compare June 27, 2026 20:38
@renovate renovate Bot force-pushed the renovate/rector-rector-2.x branch from 6714d86 to fc8ba3f Compare July 5, 2026 01:54
@renovate renovate Bot changed the title chore(deps): update dependency rector/rector to v2.5.2 chore(deps): update dependency rector/rector to v2.5.3 Jul 5, 2026
@renovate renovate Bot force-pushed the renovate/rector-rector-2.x branch from fc8ba3f to 91f58ed Compare July 6, 2026 18:51
@renovate renovate Bot changed the title chore(deps): update dependency rector/rector to v2.5.3 chore(deps): update dependency rector/rector to v2.5.4 Jul 6, 2026
@renovate renovate Bot force-pushed the renovate/rector-rector-2.x branch 4 times, most recently from 9cbcd1e to a1140dd Compare July 9, 2026 16:11
@renovate renovate Bot changed the title chore(deps): update dependency rector/rector to v2.5.4 chore(deps): update dependency rector/rector to v2.5.5 Jul 9, 2026
@renovate renovate Bot force-pushed the renovate/rector-rector-2.x branch 5 times, most recently from 75f3eac to b642092 Compare July 12, 2026 12:54
@renovate renovate Bot changed the title chore(deps): update dependency rector/rector to v2.5.5 chore(deps): update dependency rector/rector to v2.5.6 Jul 12, 2026
@renovate renovate Bot force-pushed the renovate/rector-rector-2.x branch 2 times, most recently from 0fb2454 to 353c6a9 Compare July 13, 2026 14:24
@renovate renovate Bot force-pushed the renovate/rector-rector-2.x branch from 353c6a9 to c413eae Compare July 13, 2026 20:30
@renovate renovate Bot changed the title chore(deps): update dependency rector/rector to v2.5.6 chore(deps): update dependency rector/rector to v2.5.7 Jul 13, 2026
@github-actions

Copy link
Copy Markdown

Code Coverage

Package Line Rate Complexity Health
Command/AliasAddCommand.php 93% 12
Command/DKIMDisableCommand.php 96% 6
Command/DKIMSetupCommand.php 95% 16
Command/DomainAddCommand.php 94% 6
Command/FetchmailAccountAddCommand.php 93% 9
Command/InitSetupCommand.php 100% 13
Command/RedisSyncCommand.php 90% 4
Command/SystemCheckCommand.php 94% 24
Command/Trait/ConnectionCheckTrait.php 73% 3
Command/UserAddCommand.php 80% 11
Command/VersionCheckCommand.php 100% 13
Controller/Admin/AliasCrudController.php 79% 11
Controller/Admin/DKIMCrudController.php 100% 6
Controller/Admin/DashboardController.php 97% 10
Controller/Admin/DnsWizardAction.php 94% 7
Controller/Admin/DomainCrudController.php 100% 5
Controller/Admin/Observability/DovecotStatsController.php 100% 22
Controller/Admin/Observability/RspamdStatsController.php 98% 11
Controller/Admin/UserCrudController.php 81% 18
Controller/Autoconfig/AutoconfigAction.php 100% 4
Controller/Autoconfig/AutodiscoverAction.php 100% 4
Controller/Security/LoginAction.php 100% 3
Controller/Security/LogoutAction.php 100% 1
Controller/User/ChangePasswordAction.php 96% 6
Controller/User/FetchmailAccountController.php 70% 16
Controller/User/MobileConfigAction.php 67% 4
DependencyInjection/Compiler/AppSecretGeneratorCompilerPass.php 100% 7
Entity/Alias.php 100% 9
Entity/DkimInfoTrait.php 100% 6
Entity/Domain.php 100% 13
Entity/FetchmailAccount.php 100% 17
Entity/User.php 88% 30
Exception/DKIM/DomainKeyNotFoundException.php 0% 0
Exception/DomainNotFoundException.php 100% 1
Exception/Dovecot/DoveadmAuthenticationException.php 0% 0
Exception/Dovecot/DoveadmConnectionException.php 0% 0
Exception/Dovecot/DoveadmException.php 0% 0
Exception/Dovecot/DoveadmResponseException.php 0% 0
Factory/UserFactory.php 100% 5
Form/Type/ChangePasswordType.php 100% 2
Form/Type/OAuthRegisterType.php 100% 2
Kernel.php 0% 1
Repository/AliasRepository.php 100% 1
Repository/DomainRepository.php 100% 1
Repository/FetchmailAccountRepository.php 100% 1
Repository/UserRepository.php 85% 4
Service/ApplicationVersionService.php 100% 8
Service/ConnectionCheckService.php 100% 28
Service/DKIM/Config/Manager.php 100% 2
Service/DKIM/Config/MapGenerator.php 100% 7
Service/DKIM/DKIMStatus.php 100% 5
Service/DKIM/DKIMStatusService.php 100% 7
Service/DKIM/DomainKeyReaderService.php 100% 4
Service/DKIM/FormatterService.php 100% 1
Service/DKIM/KeyGenerationService.php 100% 3
Service/DKIM/KeyPair.php 100% 3
Service/DKIM/RuntimeDataLoader.php 100% 3
Service/DnsWizard/Check/ARecordCheck.php 100% 10
Service/DnsWizard/Check/AaaaRecordCheck.php 100% 10
Service/DnsWizard/Check/AutodiscoveryRecordCheck.php 100% 28
Service/DnsWizard/Check/DkimRecordCheck.php 100% 8
Service/DnsWizard/Check/DmarcRecordCheck.php 100% 10
Service/DnsWizard/Check/DnsCheckInterface.php 0% 0
Service/DnsWizard/Check/MxRecordCheck.php 100% 10
Service/DnsWizard/Check/PtrRecordCheck.php 100% 8
Service/DnsWizard/Check/SpfRecordCheck.php 100% 10
Service/DnsWizard/DnsLookupInterface.php 0% 0
Service/DnsWizard/DnsWizardRow.php 100% 1
Service/DnsWizard/DnsWizardStatus.php 0% 0
Service/DnsWizard/DnsWizardValidator.php 100% 6
Service/DnsWizard/ExpectedHostIps.php 100% 2
Service/DnsWizard/HostIpResolver.php 98% 17
Service/DnsWizard/NativeDnsLookup.php 70% 44
Service/DnsWizard/Scopes.php 0% 1
Service/Dovecot/DTO/DoveadmHealthDto.php 100% 7
Service/Dovecot/DTO/HealthStatus.php 0% 0
Service/Dovecot/DTO/RateSeriesDto.php 100% 9
Service/Dovecot/DTO/StatsDumpDto.php 67% 9
Service/Dovecot/DoveadmHttpClient.php 81% 76
Service/Dovecot/DovecotChartFactory.php 99% 9
Service/Dovecot/DovecotRateCalculator.php 100% 21
Service/Dovecot/DovecotStatsSampler.php 97% 17
Service/FetchmailAccount/AccountData.php 100% 1
Service/FetchmailAccount/AccountWriter.php 75% 4
Service/FetchmailAccount/RedisKeys.php 75% 4
Service/FetchmailAccount/RuntimeData.php 0% 0
Service/FetchmailAccount/RuntimeDataLoader.php 100% 4
Service/GitHubTagService.php 100% 8
Service/MobileConfig/MobileConfigService.php 89% 14
Service/Rspamd/DTO/ActionDistributionDto.php 91% 9
Service/Rspamd/DTO/ActionThresholdDto.php 100% 1
Service/Rspamd/DTO/HealthDto.php 100% 7
Service/Rspamd/DTO/HistoryRowDto.php 100% 1
Service/Rspamd/DTO/KpiValueDto.php 14% 7
Service/Rspamd/DTO/RspamdSummaryDto.php 100% 1
Service/Rspamd/DTO/SymbolCounterDto.php 100% 1
Service/Rspamd/DTO/TimeSeriesDto.php 100% 5
Service/Rspamd/RspamdChartFactory.php 96% 24
Service/Rspamd/RspamdClientException.php 100% 5
Service/Rspamd/RspamdConstants.php 0% 1
Service/Rspamd/RspamdControllerClient.php 94% 33
Service/Rspamd/RspamdStatsService.php 87% 117
Service/Security/Roles.php 0% 1
Service/Security/User/OAuth/AccountConnector.php 100% 3
Service/Security/User/OAuth/DenyRegistrationSubscriber.php 100% 5
Service/Security/User/OAuth/RegistrationFormHandler.php 100% 6
Service/Security/User/OAuth/UserProvider.php 100% 18
Service/Security/Voter/DomainAdminVoter.php 100% 10
Service/Security/Voter/FetchmailAccountVoter.php 100% 8
Service/UserChangeListener.php 100% 5
Subscriber/DKIM/ConfigSyncSubscriber.php 100% 5
Subscriber/DKIM/CreatePrivateKeyOnActivationSubscriber.php 92% 8
Twig/VersionExtension.php 100% 9
Validator/DomainName.php 100% 1
Validator/DomainNameValidator.php 74% 12
Summary 92% (2842 / 3078) 1067

Minimum allowed line rate is 60%

@renovate renovate Bot merged commit 56f96a0 into main Jul 14, 2026
4 checks passed
@renovate renovate Bot deleted the renovate/rector-rector-2.x branch July 14, 2026 01:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants