[PHP]Creating instance of dynamic class
18 Apr 2018$classPath = \explode("\\", __NAMESPACE__);
\array_pop($classPath);
$newPath = \implode("\\", $classPath) . "\\Drivers\\";
$className = $newPath . Str::studly($this->driver);
if (!\class_exists($className)) {
throw new DriverException('Could not find driver');
}
return new $className();