Allow static code analysis for 3rd party libraries [5.2.2-B1]
Recently I've stumbled upon https://github.com/goaop/parser-reflection a library, that allows to perform static code analysis. The core difference from other similar solutions is that instead of autoloading classes (memory heavy operation) it uses autoloader to find the file and then tokenizes file manually.
Since In-Portal uses both Composer and it's own auto-loader it isn't possible currently to make use of that library.
Solution
create public "
kFactory::findClassFile($class)" method, that will return absolute path to file, where given class/interface/trait is locatedcreate public "
kApplication::findClassFile($class)" method, that will call above created method on "$this->Factory" objectcreate "
/tools/class_locator.php" file, that would return closure, that:would accept "
$class" argumentreturn result of "
kApplication::findClassFile" method, when not "false"return result of "
Composer\Autoload\ClassLoader::findFile" method otherwise