-
-
Notifications
You must be signed in to change notification settings - Fork 224
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
ReferenceRepository::getIdentifier()
return type not compatible with all supported object managers
#504
Comments
After giving this a cursory glance, I think the type could be relaxed. I also saw an inconsistency: data-fixtures/src/ReferenceRepository.php Lines 37 to 39 in 26536cc
is not consistent with data-fixtures/src/ReferenceRepository.php Lines 211 to 213 in 26536cc
I might work on this later, but feel free to beat me to it. |
PR for 1.8: #506 |
Thank you! |
Bug Report
Summary
In 2.0, the
ReferenceRepository::getIdentifier()
method has an array return type (compared to 1.x where this was in the doc block only), however, this return type is not compatible with the returns from the MongoDB ODM'sUnitOfWork::getDocumentIdentifier()
(mixed) or the PHPCR ODM'sUnitOfWork::getDocumentId()
(string or null).Current behavior
The
ReferenceRepository::getIdentifier()
method only works correctly when an object is registered to any unit of work or can fetch the identifier from the ORM's unit of work.Expected behavior
The
ReferenceRepository::getIdentifier()
method should work regardless of the object manager and its unit of work.How to reproduce
I haven't yet taken the time to extract this out to a standalone test case, but working on liip/LiipTestFixturesBundle#326 the CI fails in that PR point to this type error:
The text was updated successfully, but these errors were encountered: