Skip to content

Provided cross-compatibility between doctrine/persistence v2 and v3#720

Merged
alongosz merged 12 commits into4.6from
doctrine-persistence-require
Mar 3, 2026
Merged

Provided cross-compatibility between doctrine/persistence v2 and v3#720
alongosz merged 12 commits into4.6from
doctrine-persistence-require

Conversation

@wiewiurdp
Copy link
Copy Markdown
Contributor

@wiewiurdp wiewiurdp commented Feb 27, 2026

🎫 Issue Relates to IBX-11179

Note

Taken over by @alongosz

Related PRs:

Description:

Implementations of \Doctrine\Persistence\ObjectManager differ between doctrine/persistence versions v2 and v3. Given the risk that putting new constraint on that package version might block existing projects from upgrading, we've aimed to provide a SiteAccessAwareEntityManager (implementing indirectly ObjectManager) class which is cross-compatible between both versions.

There's no way to uniformly resolve PHPStan issues across both versions. We've introduced doctrine/persistence version detection to load proper baseline.

For QA:

Failing builds:

Commerce regression: ibexa/commerce#1709

Documentation:

No documentation required.

@wiewiurdp wiewiurdp changed the title Add "doctrine/persistence" dependency to composer.json [DON'T MERGE] Add "doctrine/persistence" dependency to composer.json Feb 27, 2026
@alongosz alongosz force-pushed the doctrine-persistence-require branch from 6a68215 to c44face Compare February 27, 2026 18:19
@alongosz alongosz changed the title [DON'T MERGE] Add "doctrine/persistence" dependency to composer.json Provided cross-compatibility between doctrine/persistence v2 and v3 Feb 27, 2026
@alongosz alongosz marked this pull request as ready for review February 27, 2026 18:31
*/
public function clear($objectName = null): void
{
$this->getWrapped()->clear();
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We probably need to pass the 1st argument to the wrapped entity manager, regardless if it declares that it accepts an argument or not. Otherwise we will not be respecting the behavior of persistence v2 which allowed partial clear.

@konradoboza
Copy link
Copy Markdown
Contributor

konradoboza commented Mar 2, 2026

@alongosz to reduce the amount of check we can get rid of PHP 8.0 - 8.2 jobs from the matrix in favor of PHP 8.3 and 8.4. This can be done as a followup.

alongosz and others added 4 commits March 2, 2026 14:03
* Provided cross-compatibility between doctrine/persistence v2 and v3 for SiteAccessAwareEntityManager
…age version

Co-authored-by: OpenAI Codex <codex@openai.com>
Co-Authored-By: Paweł Niedzielski <Steveb-p@users.noreply.github.com>
@alongosz alongosz force-pushed the doctrine-persistence-require branch from c44face to cd46bed Compare March 2, 2026 13:17
alongosz added 2 commits March 2, 2026 14:20
Temporarily replaced PHP 8.0-8.1 with PHP 8.2, to be permanently replaced with PHP 8.3 and 8.4.
@alongosz alongosz force-pushed the doctrine-persistence-require branch from cd46bed to 3136c28 Compare March 2, 2026 13:20
@sonarqubecloud
Copy link
Copy Markdown

sonarqubecloud Bot commented Mar 2, 2026

@alongosz
Copy link
Copy Markdown
Member

alongosz commented Mar 2, 2026

@alongosz to reduce the amount of check we can get rid of PHP 8.0 - 8.2 jobs from the matrix in favor of PHP 8.3 and 8.4. This can be done as a followup.

@konradoboza The number of jobs has been reduced. I've removed doctrine matrix from unit & SQLite tests, keeping it only for MySQL and PostgreSQL, as essential. However for unit & SQLite I kept PHP 8.1 as a temporary measure to have at least one unit and integration running on PHP 8.x series. All of it to be replaced with PHP 8.3 & 8.4 as a follow-up right after merging this one.

@konradoboza
Copy link
Copy Markdown
Contributor

Sounds good, thank you @alongosz.

@alongosz alongosz merged commit f1e6571 into 4.6 Mar 3, 2026
26 checks passed
@alongosz alongosz deleted the doctrine-persistence-require branch March 3, 2026 09:25
@alongosz alongosz mentioned this pull request Mar 3, 2026
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.

7 participants