You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 

42 lines
689 B

<?php
namespace App\Handlers;
/**
*
*
*
*/
abstract class Handler
{
/**
*
*
* @param String $className
* @return Mixed
*
*/
protected function getHandlerClass(String $className)
{
$result = NULL;
// create class
$class = 'App\\Handlers\\'.$className);
// if not found check for custom handlers
if (class_exists($class)) {
$result = new $class();
} else {
// create class
$class = 'CustomHandlers\\'.$className;
if (class_exists($class)) {
$result = new $class();
}
}
return $result;
}
}