PHPDaemon\SockJS\Application::callMethod PHP Method

callMethod() public method

callMethod
public callMethod ( string $method, object $req, object $upstream ) : object
$method string [@todo description]
$req object [@todo description]
$upstream object [@todo description]
return object
    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);
    }