protected function getHttpStatusCode(Exception $exception): int
    {
        if ($exception instanceof ApiException) {
            return $exception->apiMessage->getHttpStatusCode();
        }

        if ($exception instanceof HttpExceptionInterface && method_exists($exception, 'getStatusCode')) {
            return $exception->getStatusCode();
        }

        return 500;
    }
protected function getHttpStatusCode(Exception $exception): int
    {
        if ($exception instanceof ApiException) {
            return $exception->apiMessage->getHttpStatusCode();
        }

        if ($exception instanceof HttpExceptionInterface && method_exists($exception, 'getStatusCode')) {
            return $exception->getStatusCode();
        }

        return 500;
    }
protected function getHttpStatusCode ( Exception $ exception ) : int { if ( $ exception instanceof ApiException ) { return $ exception -> apiMessage -> getHttpStatusCode ( ) ; } if ( $ exception instanceof HttpExceptionInterface && method_exists ( $ exception , 'getStatusCode' ) ) { return $ exception -> getStatusCode ( ) ; } return 500 ; }
Get the Http status code from the exception.

@param \Exception $exception

@return int
Get the Http status code from the exception .