Skip to content

[symfony 8.2] Add Symfony 8.2 rules: Schedule::with() to add() and Doctrine middleware renames - #1082

Merged
TomasVotruba merged 1 commit into
mainfrom
symfony-82-rules
Oct 20, 2026
Merged

TomasVotruba merged 1 commit into
mainfrom
symfony-82-rules

Conversation

@TomasVotruba

Copy link
Copy Markdown
Member

Adds first rules targeting Symfony 8.2 deprecations.

ScheduleWithToAddRector

Schedule::with() is deprecated in 8.2. Internally it always did doAdd(new self(), ...), i.e. derived from a fresh empty Schedule, so the exact replacement is (new Schedule())->add(...) (not clone, which would keep the receiver's messages).

-$schedule = (new Schedule())->with($recurringMessage);
+$schedule = (new Schedule())->add($recurringMessage);

Gated on symfony/scheduler >=8.2. Stubs added since the package is not installed.

Doctrine middleware renames (RenameClassRector)

Added to composer-based.php, gated on symfony/doctrine-bridge >=8.2:

  • DoctrineCloseConnectionMiddleware -> DoctrineDbalCloseConnectionMiddleware
  • DoctrinePingConnectionMiddleware -> DoctrineDbalPingConnectionMiddleware

Constructors are type-compatible (ManagerRegistry extends ConnectionRegistry, second arg stays string-compatible), so a plain class rename is safe.

DoctrineOpenTransactionLoggerMiddleware is intentionally not renamed: its constructor argument order changed (logger moves to 2nd position), so a bare class rename would produce broken instantiations.

Ref: https://github.com/symfony/symfony/blob/8.2/UPGRADE-8.2.md

Note: Symfony 8.2 is not released yet, so the API may still change.

@TomasVotruba TomasVotruba changed the title Add Symfony 8.2 rules: Schedule::with() to add() and Doctrine middleware renames [symfony 8.2] Add Symfony 8.2 rules: Schedule::with() to add() and Doctrine middleware renames Oct 20, 2026
@TomasVotruba
TomasVotruba merged commit 30fe29b into main Oct 20, 2026
8 checks passed
@TomasVotruba
TomasVotruba deleted the symfony-82-rules branch October 20, 2026 17:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant