Skip to content

Add support for doctrine/collections 3.x#1212

Merged
veewee merged 1 commit intophpro:v2.xfrom
a-treschilov:feature/doctrine-collections-3x
Mar 30, 2026
Merged

Add support for doctrine/collections 3.x#1212
veewee merged 1 commit intophpro:v2.xfrom
a-treschilov:feature/doctrine-collections-3x

Conversation

@a-treschilov
Copy link
Copy Markdown
Contributor

@a-treschilov a-treschilov commented Mar 28, 2026

Summary

  • Extends the doctrine/collections version constraint from ^1.6.8 || ^2.0 to ^1.6.8 || ^2.0 || ^3.0
  • No code changes required — GrumPHP's collection classes only use core ArrayCollection methods that remain fully compatible in 3.x
  • doctrine/collections 3.0.0 requires PHP 8.4+, so Composer's platform resolution automatically selects 3.x on PHP 8.4/8.5 and 2.x on PHP 8.2/8.3

Compatibility notes

  • filter() and map() gained native Collection return types in 3.x; FilesCollection::filter(): self is a valid covariant override ✓
  • Internally filter() still uses createFrom()new static(), so subclasses continue to receive their own type at runtime ✓
  • No GrumPHP code extends any of the classes made final in 3.x (Criteria, Expr\*, ExpressionBuilder) ✓

Checklist

  • Branch: v2.x
  • Bug fix: no
  • New feature: no
  • BC breaks: no
  • Deprecations: no
  • Fixed tickets: N/A

doctrine/collections 3.0.0 requires PHP 8.4+, which GrumPHP already
supports. Composer's platform resolution ensures 3.x is only installed
on PHP 8.4+ while 2.x remains used on PHP 8.2/8.3.
@a-treschilov a-treschilov force-pushed the feature/doctrine-collections-3x branch from d4c919c to bdb87d6 Compare March 29, 2026 18:57
@veewee veewee merged commit 44eb693 into phpro:v2.x Mar 30, 2026
26 checks passed
@veewee
Copy link
Copy Markdown
Contributor

veewee commented Mar 30, 2026

Thanks!

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.

2 participants