Details
-
Type:
Improvement
-
Status:
Closed
-
Priority:
Minor
-
Resolution: Fixed
-
Affects Version/s: None
-
Fix Version/s: 2.0-BETA4
-
Component/s: None
-
Security Level: All
-
Labels:None
Description
If one calls $em->getRepository('\Entity') (leading \ !) then Doctrine's behaviour is quite undefined, as it would result e.g. in a "mapping file '.entity.dcm.yml' not found" error. (leading dot!)
PHP, however, seems to allow the leading \, but Doctrine does not. In fact, the leading \ is not necessary as classnames in strings are always fully qualified.
So Doctrine should either:
1.) Throw an exception stating that using a leading backslash is prohibited
2.) Simply strip it.
I vote for 1. Stripping the char just leads to major overhead given that getMetadataFor is one of the most called functions in Doctrine 2.