I'm converting a serie of classes I've developed into using namespaces.
One of those clases has a dependency:
File A
namespace VENDOR
class A{
static public function(){
B::getInfo();
}
}
File B
namespace VENDOR;
class B{
static public function getInfo(){
//some work
}
}
Then, this belongs to a personal library that I will include into a project. Class B is susceptible to be extended:
namespace APPNAMESPACE
class SuperB extends \VENDOR\B{
static public function getInfo(){
//Some different work
}
}
My intention is that VENDOR\A calls APPNAMESPACE\SuperB, but here is where I see I'm not designing my system well as obviously it will continue to call VENDOR\B.
Previously to this I could achieve this behaviour as I was not using namespaces at all but the classical class naming convention DIR_CLASS.php that allowed my autoloader (using composer now) to look in first in high priority APP folder and if not found in other folders with less priority (similar to kohana, Codeigniter and others).
So how do I approach this (obviously without hardcoding APPNAMESPACE\SuperB into VENDOR\A)