Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Address deprecation from DoctrineBundle#531

Merged
greg0ire merged 1 commit into
doctrine:3.3.xfrom
greg0ire:address-deprecation
Mar 25, 2024
Merged

Address deprecation from DoctrineBundle#531
greg0ire merged 1 commit into
doctrine:3.3.xfrom
greg0ire:address-deprecation

Conversation

@greg0ire
Copy link
Copy Markdown
Member

@greg0ire greg0ire commented Mar 25, 2024

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

@greg0ire greg0ire force-pushed the address-deprecation branch from 55d309a to 256cb21 Compare March 25, 2024 11:34
@stof
Copy link
Copy Markdown
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 greg0ire force-pushed the address-deprecation branch from 256cb21 to 404754e Compare March 25, 2024 12:46
@greg0ire
Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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.
@greg0ire greg0ire force-pushed the address-deprecation branch from 404754e to 4479e12 Compare March 25, 2024 13:04
'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
Copy Markdown
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
@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.

3 participants