Bug Report
Summary
Using DateTime (or other global namespace classes) with assertions enabled can cause an assertion failure in SymfonyFileLocator.
Current behavior
assert(is_int($pos)); fails if $className doesn't contain a \, which is the case for DateTime.
Expected behavior
Not triggering an assert, obviously, but I'm not well-versed enough in doctrine internals to say how it should work. Either the assert should be removed (and the following exception adjusted accordingly) or findMappingFile shouldn't be called in the first place.
How to reproduce
A quite tiny repro:
$locator = new Doctrine\Persistence\Mapping\Driver\SymfonyFileLocator([]);
$locator->findMappingFile(DateTime::class);
A more realistic way to trigger this is to call \Doctrine\ORM\AbstractQuery::setParameter with a DateTime as value but WITHOUT explicitly declaring the type in the third (type) parameter:
$someQuery->setParam('foo', new DateTime());
Bug Report
Summary
Using DateTime (or other global namespace classes) with assertions enabled can cause an assertion failure in SymfonyFileLocator.
Current behavior
assert(is_int($pos));fails if $className doesn't contain a\, which is the case for DateTime.Expected behavior
Not triggering an assert, obviously, but I'm not well-versed enough in doctrine internals to say how it should work. Either the assert should be removed (and the following exception adjusted accordingly) or
findMappingFileshouldn't be called in the first place.How to reproduce
A quite tiny repro:
A more realistic way to trigger this is to call
\Doctrine\ORM\AbstractQuery::setParameterwith a DateTime as value but WITHOUT explicitly declaring the type in the third (type) parameter:$someQuery->setParam('foo', new DateTime());