Reputation: 88397
i am wondering why my namespaces are not resolved correctly ... i have
use \Doctrine\ORM;
...
} catch (NoResultException $e) { // shld resolve to \Doctrine\ORM\NoResultException but fails
...
} catch () {
// code always ends up here if NoResultException is thrown
// unless i fully qualify the class as\Doctrine\ORM\NoResultException
}
Upvotes: 0
Views: 274
Reputation: 3282
use \Doctrine\ORM;
This declare an alias named ORM that points to \Doctrine\ORM. It doesn't mean that all the class name you mention in your code will use this alias. You still have to specify that you want to use it like this :
catch (ORM\NoResultException) {
ORM\NoResultException will point to \Doctrine\ORM\NoResultException
Upvotes: 2