original_string: public function dispatch(ResponseInterface $response, int $status, $result)
      {
          // Build output array
          $contents = [
              'status' => $status,
              'result' => $result,
          ];
  
          // Convert output to JSON
          $contents = json_encode($contents, JSON_PRETTY_PRINT);
  
          // Write Response to Body
          $response->getBody()->write($contents);
  
          // PSR-7 response
          return $response->withStatus($status); 
      }
code: public function dispatch(ResponseInterface $response, int $status, $result)
      {
          // Build output array
          $contents = [
              'status' => $status,
              'result' => $result,
          ];
  
          // Convert output to JSON
          $contents = json_encode($contents, JSON_PRETTY_PRINT);
  
          // Write Response to Body
          $response->getBody()->write($contents);
  
          // PSR-7 response
          return $response->withStatus($status); 
      }
code_tokens: public function dispatch ( ResponseInterface $ response , int $ status , $ result ) { // Build output array $ contents = [ 'status' => $ status , 'result' => $ result , ] ; // Convert output to JSON $ contents = json_encode ( $ contents , JSON_PRETTY_PRINT ) ; // Write Response to Body $ response -> getBody ( ) -> write ( $ contents ) ; // PSR-7 response return $ response -> withStatus ( $ status ) ; }
docstring: JSON response class
  
  @param ResponseInterface $response PSR-7 HTTP response message
  @param Integer           $status   HTTP status (e.g: 200)
  @param Mixed             $result   Array, String or Object to send as JSON response
docstring_tokens: JSON response class