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.
This looks like it would break if I did a low-deps run on PHP 7.3. 🤔
There was a problem hiding this comment.
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.
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
| '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.
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.