Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Address deprecation from DoctrineBundle #531

Merged
merged 1 commit into from Mar 25, 2024

Conversation

greg0ire
Copy link
Member

@greg0ire greg0ire commented Mar 25, 2024

This fixes the build, which is sensitive to deprecations on this repository.

@stof
Copy link
Member

stof commented Mar 25, 2024

Can't we always set this configuration entry ? Or do we still support old versions of the bundle that don't have this setting ?

@greg0ire
Copy link
Member Author

greg0ire commented Mar 25, 2024

Can't we always set this configuration entry ? Or do we still support old versions of the bundle that don't have this setting ?

That's what I did in my initial try, and we support old versions of PHP which prevent installing a recent enough version of the bundle (or at least that's what I think is happening).

Comment on lines 290 to 292
if (PHP_VERSION_ID >= 73000) {
$ormConfig['controller_resolver'] = ['auto_mapping' => false];
}
Copy link
Member

Choose a reason for hiding this comment

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

This looks like it would break if I did a low-deps run on PHP 7.3. 🤔

Copy link
Member Author

Choose a reason for hiding this comment

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

It would, I couldn't find a reliable way to detect the right version of the bundle. Since this detection code only occurs in tests, I thought it would not be a big deal.

Copy link
Member

Choose a reason for hiding this comment

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

Shall we try Composer\InstalledVersions instead then?

The deprecation can only be addressed for recent enough versions of the
bundle, which are quite hard to detect.
@@ -285,6 +287,10 @@ public function testPrefersEntityManagerOverConnection(): void
'migrations_paths' => ['DoctrineMigrationsTest' => 'a'],
];
$ormConfig = trait_exists(LazyGhostTrait::class) ? ['enable_lazy_ghost_objects' => true] : [];
if (InstalledVersions::satisfies(new VersionParser(), 'doctrine/doctrine-bundle', '^2.7.1 ')) {
Copy link
Member Author

@greg0ire greg0ire Mar 25, 2024

Choose a reason for hiding this comment

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

I'm using the version at which the option was introduced, not the version at which it was deprecated. See doctrine/DoctrineBundle@71d6411

@derrabus derrabus added Test Suite and removed Bug labels Mar 25, 2024
@derrabus derrabus added this to the 3.3.1 milestone Mar 25, 2024
@greg0ire greg0ire merged commit e60395b into doctrine:3.3.x Mar 25, 2024
15 checks passed
@greg0ire greg0ire deleted the address-deprecation branch March 25, 2024 13:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants