persistence icon indicating copy to clipboard operation
persistence copied to clipboard

Fix bug in namespace check in MappingDriverChain

Open ttk opened this issue 1 year ago • 3 comments

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 className Doctrine\Tests\Persistence\Mapping\DriverChainEntity or not? The current logic would match, but I'm not sure if it should....

ttk avatar Dec 14 '23 23:12 ttk