Skip to content

Upgraded to Doctrine ORM 3 - #322

Merged
peter-gribanov merged 2 commits into
Happyr:2.xfrom
Shifrin:upgrade-to-doctrine-orm-3
Jul 28, 2026
Merged

Upgraded to Doctrine ORM 3#322
peter-gribanov merged 2 commits into
Happyr:2.xfrom
Shifrin:upgrade-to-doctrine-orm-3

Conversation

@Shifrin

@Shifrin Shifrin commented Mar 12, 2026

Copy link
Copy Markdown
Contributor

I added support for Doctrine ORM 3 by upgrading the dependencies and removed support for the older versions, so the update isn't backward compatible. And the minimum PHP version is set to ">= 8.1".

@mmmsafry

Copy link
Copy Markdown

great work @Shifrin

@peter-gribanov

Copy link
Copy Markdown
Member

@Shifrin Good job. Thank you.
Please fix the checks. 14 out of 17 checks are failing. I can't accept the PR in this state.
You've increased the PHP version in the project's dependencies. Please remove checks on older versions.

@Shifrin

Shifrin commented Jul 8, 2026

Copy link
Copy Markdown
Contributor Author

@peter-gribanov Thank you, I have removed the checks for the older PHP versions prior to 8.1. Please try again.

@peter-gribanov

Copy link
Copy Markdown
Member

@Shifrin unfortunately, not all tests were passed. You may need to increase the minimum version in Composer's requirements.

@peter-gribanov

Copy link
Copy Markdown
Member

@Shifrin i've expanded the settings. Tests should now run automatically.

@Shifrin

Shifrin commented Jul 16, 2026

Copy link
Copy Markdown
Contributor Author

@peter-gribanov The minimum version was set already in the composer.json as 8.1, And also I updated the pipeline by removing the PHP version prior to 8.1 checks.

@peter-gribanov
peter-gribanov merged commit 8d83035 into Happyr:2.x Jul 28, 2026
5 of 10 checks passed
@peter-gribanov

Copy link
Copy Markdown
Member

Good job. Thanks 👍

peter-gribanov added a commit that referenced this pull request Jul 28, 2026
PR #322 replaced the ORM constraint instead of widening it, which turned
an additive feature into a BC break and would have forced a major release.
Doctrine ORM 3 support is additive instead, matching how Symfony 7 support
shipped in v2.1.0.

All three src changes from #322 are already BC:

  - Type::hasType()        available since DBAL 2.9.0
  - enableResultCache()    available since ORM 2.8.0
  - toIterable()           available since ORM 2.8.0

The ORM floor is ^2.17 rather than ^2.5 because the specs now double
Doctrine\ORM\Query, which was final up to and including ORM 2.16 and only
became non-final in 2.17.0.

symfony/polyfill-php80 has to come back: src/Filter/Like.php calls
str_starts_with(), str_ends_with() and str_contains(), which only exist on
PHP 7.x through that polyfill.

Also fixes the three failing test jobs:

  - PHP 8.4 (highest and lowest) could not resolve at all, since PHP 8.4
    support only landed in phpspec ^8.0.
  - PHP 8.1 + lowest died with "'\static' is an invalid class name",
    because --prefer-lowest resolved prophecy 1.14.0 while support for the
    static return type only arrived in 1.15.0, and ORM 3 uses static on
    its fluent setters. phpspec 7.x only requires prophecy ^1.9, so the
    constraint has to be explicit.

Restoring the PHP 7.2-8.0 matrix rows is also required for the 2.x branch
protection to stay satisfiable: "PHP 7.4 + highest + normal" and
"PHP 8.0 + highest + normal" are required status checks, and #322 deleted
the jobs that report them.
peter-gribanov added a commit that referenced this pull request Jul 28, 2026
Also pre-existing and unrelated to ORM 3. The QA job installs whatever
php-cs-fixer is current, and the @PhpCsFixer ruleset has grown rules since
the last sweep: static_lambda, single_line_empty_body, no_extra_blank_lines,
whitespace_after_comma_in_array, ordered_imports, phpdoc_separation and a
few more. On a clean 2.x this reported 40 files; #322 had already brought
that down to 31 by reformatting the tests it touched.

No behaviour change. The specs still pass 527/527 and phpstan is still
clean. Running the fixer a second time reports nothing, so the tree is now
a fixed point of the current ruleset.
@peter-gribanov

Copy link
Copy Markdown
Member

The upgrade was released in version v2.2.0.

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.

3 participants