original_string: 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;
      }
code: 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;
      }
code_tokens: 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 ; }
docstring: Encode and return status response.
  
  @param  StatusResponse    $action_result
  @param  ResponseInterface $response
  @return ResponseInterface
docstring_tokens: Encode and return status response .