Open mbabker opened 20 hours ago
After giving this a cursory glance, I think the type could be relaxed. I also saw an inconsistency: https://github.com/doctrine/data-fixtures/blob/26536cc8a47f29432bfa4e1f117b23cff145cd1f/src/ReferenceRepository.php#L37-L39
is not consistent with
I might work on this later, but feel free to beat me to it.
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 https://github.com/liip/LiipTestFixturesBundle/pull/326 the CI fails in that PR point to this type error: