persistence
persistence copied to clipboard
Fix bug in namespace check in MappingDriverChain
This fix improves the checking if a namespace appears in a className by ensuring that the namespace ends in a \
. Prior to this fix, the following would occur:
A className such as Doctrine\Tests\Persistence\Mapping\DriverChainEntity
would match the namespace: Doctrine\Tests\Persistence\Map
, which isn't correct.
Other considerations:
- what if the namespace already ends in a
\
? is this a valid case? Probably not. - what if it's a parent namespace. In the above example, this would be
Doctrine\Tests\Persistence
. Should this match against the classNameDoctrine\Tests\Persistence\Mapping\DriverChainEntity
or not? The current logic would match, but I'm not sure if it should....