Closed
Description
There is a return type contract violation in stable 2.5.x branch for count()
method in BasicEntityPersister
class: string returned instead of integer
https://github.com/doctrine/doctrine2/blob/e1b851f2e93a4afd82fb7e7f32c6f114d0ea7b71/lib/Doctrine/ORM/P
5FD5
ersisters/Entity/BasicEntityPersister.php#L811-L824
causing incorrect behavior in case like:
/** @var $coll Doctrine\ORM\LazyCriteriaCollection */
if ($coll->count() === 0) {
// unreachable code
}
it seems to be fixed as a collateral change in master
and needs to be backported somehow:
a90035e#diff-25f5292f65d5536bb733559f15e0d37fR825