public function callMethod($method, $req, $upstream)
{
$method = strtr(ucwords(strtr($method, ['_' => ' '])), [' ' => '']);
if (strtolower($method) === 'generic') {
$method = 'NotFound';
}
$class = __NAMESPACE__ . '\\Methods\\' . $method;
if (!class_exists($class)) {
$class = __NAMESPACE__ . '\\Methods\\NotFound';
}
return new $class($this, $upstream, $req);
}