private function findHandlerForMessage($messageName)
    {
        $handler = null;

        if (array_key_exists($messageName, $this->responseHandlers) &&
            $this->responseHandlers[$messageName] instanceof MessageResponseHandler
        ) {
            $handler = $this->responseHandlers[$messageName];
        } else {
            $section = substr($messageName, 0, strpos($messageName, '_'));
            $message = substr($messageName, strpos($messageName, '_') + 1);

            $handlerClass = __NAMESPACE__.'\\'.$section.'\\Handler'.$message;

            if (class_exists($handlerClass)) {
                /** @var MessageResponseHandler $handler */
                $handler = new $handlerClass();

                $this->responseHandlers[$messageName] = $handler;
            }
        }

        return $handler;
    }
private function findHandlerForMessage($messageName)
    {
        $handler = null;

        if (array_key_exists($messageName, $this->responseHandlers) &&
            $this->responseHandlers[$messageName] instanceof MessageResponseHandler
        ) {
            $handler = $this->responseHandlers[$messageName];
        } else {
            $section = substr($messageName, 0, strpos($messageName, '_'));
            $message = substr($messageName, strpos($messageName, '_') + 1);

            $handlerClass = __NAMESPACE__.'\\'.$section.'\\Handler'.$message;

            if (class_exists($handlerClass)) {
                
                $handler = new $handlerClass();

                $this->responseHandlers[$messageName] = $handler;
            }
        }

        return $handler;
    }
private function findHandlerForMessage ( $ messageName ) { $ handler = null ; if ( array_key_exists ( $ messageName , $ this -> responseHandlers ) && $ this -> responseHandlers [ $ messageName ] instanceof MessageResponseHandler ) { $ handler = $ this -> responseHandlers [ $ messageName ] ; } else { $ section = substr ( $ messageName , 0 , strpos ( $ messageName , '_' ) ) ; $ message = substr ( $ messageName , strpos ( $ messageName , '_' ) + 1 ) ; $ handlerClass = __NAMESPACE__ . '\\' . $ section . '\\Handler' . $ message ; if ( class_exists ( $ handlerClass ) ) { /** @var MessageResponseHandler $handler */ $ handler = new $ handlerClass ( ) ; $ this -> responseHandlers [ $ messageName ] = $ handler ; } } return $ handler ; }
Find or create the correct handler object for a given message

@param string $messageName
@return MessageResponseHandler|null
Find or create the correct handler object for a given message