Feature: add support for ColocatedMappingDriver::$filePaths#12106
Feature: add support for ColocatedMappingDriver::$filePaths#12106rela589n wants to merge 1 commit intodoctrine:3.6.xfrom rela589n:feat-attribute-driver-iterable-files
ColocatedMappingDriver::$filePaths#12106Conversation
composer.json
Outdated
| "symfony/var-exporter": "^6.3.9 || ^7.0" | ||
| }, | ||
| "require-dev": { | ||
| "doctrine/persistence": "^3.3.1 || ^4.0 || 4.1.x-dev", |
There was a problem hiding this comment.
We should keep this MR in draft status until this can be reverted.
There was a problem hiding this comment.
By the way, I've noticed that doctrine/DoctrineBundle has "minimum-stability": "dev", which makes possible the installation of dev versions of packages that match the constraint ("doctrine/persistence": "^3.1 || ^4" used there acquires 4.1.x-dev).
There was a problem hiding this comment.
We have a CI job that tests against unstable packages (mostly Symfony). I think, you can just add Persitence there. It makes sense to test against dev versions of Persistence.
There was a problem hiding this comment.
Do you mean to adjust phpunit-smoke-check to include persistence version 4.1-dev?
|
@derrabus since you suggested this approach, I'm requesting your review specifically |
This commit adds support for a `$pathsAsFilePaths` parameter, introduced as part of doctrine/orm#12106 It adds a minor BC break (as well as was in the case of `$reportFieldsWhereDeclared` - `8d8579`) - classes, extending `DoctrineOrmMappingsPass` that override `createAttributeMappingDriver()` method will face signature mismatch.
ColocatedMappingDriver::$filePaths
In the scope of doctrine/persistence#432 (available from `doctrine/persistence` >= 4.1) there was added `ColocatedMappingDriver::$filePaths` property, which allows passing the iterable of file paths for the mapping driver to use. This commit integrates those changes into `AttributeDriver`. Since `doctrine/orm` maintains the support for `doctrine/persistence` of older versions, `AttributeDriver` ensures that `$filePaths` is actually defined. Tests use `InstalledVersions` to opt into new behaviour if `doctrine/persistence` is version 4.1 or above. The old behaviour can be adapted into the new by using `DirectoryFilesIterator` and `FilePathNameIterator` on directory paths.
This commit adds support for a `$pathsAsFilePaths` parameter, introduced as part of doctrine/orm#12106 It adds a minor BC break (as well as was in the case of `$reportFieldsWhereDeclared` - `8d8579`) - classes, extending `DoctrineOrmMappingsPass` that override `createAttributeMappingDriver()` method will face signature mismatch.
The changes introduced add support for
ColocatedMappingDriver::$filePaths, fromdoctrine/persistence>= 4.1 (doctrine/persistence#432). Sincedoctrine/ormmaintains the support fordoctrine/persistenceof older versions,AttributeDriverensures that$filePathsis actually defined. Tests useInstalledVersionsto opt into new behavior ifdoctrine/persistenceis at least version 4.1. The old behaviour can be adapted into the new by usingDirectoryFilesIteratorandFilePathNameIteratoron directory paths.