I'm writing classes in PHP in deep namespace, but I want it to be easier to access. Is there a way to alias namespace within it's definition, not import? It's okay if it's work-around.
I want to achieve it, becouse its very, very commonly used class in code I have on hands, but moving it into more shallow namespace entirely is not an option.
I've tried to google it but all I found was import namespace aliasing, I havent found anything revelant also anything in docs.
Definition file:
namespace \Something\Really\Annoyingly\Deep AS \MyClass
class MyClass{}
Other file:
namespace \Something\Else;
use MyClass;
$obj = new MyClass();
I used "AS" here for sake of example. I know it will not work, and my question is, is it possible to make it work somehow?
\MyClass… Well, you can do this by omitting thenamespaceentirely. What's the point?