src/ResultEncoder/ResultEncoder.php
protected function encodeStatus(StatusResponse $action_result, ResponseInterface $response)
    {
        $response = $response->withStatus($action_result->getHttpCode(), $action_result->getMessage());

        if ($action_result->getHttpCode() >= 400) {
            $response = $response->write(json_encode(['message' => $action_result->getMessage()]));
        }

        return $response;
    }
protected function encodeStatus(StatusResponse $action_result, ResponseInterface $response)
    {
        $response = $response->withStatus($action_result->getHttpCode(), $action_result->getMessage());

        if ($action_result->getHttpCode() >= 400) {
            $response = $response->write(json_encode(['message' => $action_result->getMessage()]));
        }

        return $response;
    }
protected function encodeStatus ( StatusResponse $ action_result , ResponseInterface $ response ) { $ response = $ response -> withStatus ( $ action_result -> getHttpCode ( ) , $ action_result -> getMessage ( ) ) ; if ( $ action_result -> getHttpCode ( ) >= 400 ) { $ response = $ response -> write ( json_encode ( [ 'message' => $ action_result -> getMessage ( ) ] ) ) ; } return $ response ; }
Encode and return status response.

@param  StatusResponse    $action_result
@param  ResponseInterface $response
@return ResponseInterface
Encode and return status response .