Skip to content

Register SortDirection rules in composer-based set + cover Expr\OrderBy::add() - #530

Merged
TomasVotruba merged 3 commits into
mainfrom
orm37-register-sort-direction-rules
Oct 5, 2026
Merged

TomasVotruba merged 3 commits into
mainfrom
orm37-register-sort-direction-rules

Conversation

@TomasVotruba

Copy link
Copy Markdown
Member

Follow-up to #524 and #525, per rectorphp/rector#9919

The two SortDirection rules existed but were not wired into any set, so they never ran:

  • DoctrineQueryBuilderSortDirectionRector (ORM 3.2)
  • DoctrineOrderByAttributeSortDirectionRector (ORM 3.7)

Both now registered in composer-based.php, gated by their existing doctrine/orm composer constraint - no manual registration needed per project.

Also extends DoctrineQueryBuilderSortDirectionRector to cover Doctrine\ORM\Query\Expr\OrderBy::add(), the last deprecated string-direction entry point from the issue.

Note: no PHP version gate. The SortDirection enum is native in PHP 8.6 and back-filled on PHP 8.1+ via symfony/polyfill-php86, so the transform stays valid on 8.1+ with the polyfill.

@TomasVotruba

Copy link
Copy Markdown
Member Author

@stof Could you review this one? Not sure if its the right trigger.

@stof

stof commented Oct 1, 2026

Copy link
Copy Markdown

Support for SortDirection in the QueryBuilder API was merged in 3.7.0 (in doctrine/orm#12449), not in 3.2.0

@TomasVotruba

Copy link
Copy Markdown
Member Author

Updated 👍 How about now?

@TomasVotruba
TomasVotruba merged commit c48eeac into main Oct 5, 2026
8 checks passed
@TomasVotruba
TomasVotruba deleted the orm37-register-sort-direction-rules branch October 5, 2026 14:06
@TomasVotruba

Copy link
Copy Markdown
Member Author

Let's ship it 👌

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.

3 participants