-
-
Notifications
You must be signed in to change notification settings - Fork 214
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
Conversation
55d309a
to
256cb21
Compare
Can't we always set this configuration entry ? Or do we still support old versions of the bundle that don't have this setting ? |
256cb21
to
404754e
Compare
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). |
if (PHP_VERSION_ID >= 73000) { | ||
$ormConfig['controller_resolver'] = ['auto_mapping' => false]; | ||
} |
There was a problem hiding this comment.
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. 🤔
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
404754e
to
4479e12
Compare
@@ -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 ')) { |
There was a problem hiding this comment.
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
This fixes the build, which is sensitive to deprecations on this repository.