-
Notifications
You must be signed in to change notification settings - Fork 2.5k
Feature: add support for ColocatedMappingDriver::$filePaths
#12106
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
base: 3.6.x
Are you sure you want to change the base?
Feature: add support for ColocatedMappingDriver::$filePaths
#12106
Conversation
composer.json
Outdated
@@ -37,6 +37,7 @@ | |||
"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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should keep this MR in draft status until this can be reverted.
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.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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 |
684dbc0
to
8794b18
Compare
44d4b45
to
35699bf
Compare
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.
35699bf
to
df8ddf9
Compare
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.
df8ddf9
to
dbad9e2
Compare
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/orm
maintains the support fordoctrine/persistence
of older versions,AttributeDriver
ensures that$filePaths
is actually defined. Tests useInstalledVersions
to opt into new behavior ifdoctrine/persistence
is at least version 4.1. The old behaviour can be adapted into the new by usingDirectoryFilesIterator
andFilePathNameIterator
on directory paths.