src/Response.php
public function send($content, int $status = HttpResponse::HTTP_OK, array $headers = []) : HttpResponse
    {
        $headers = array_merge($this->headers, $headers);

        if (is_array($content)) {
            $content = json_encode($content);
        }

        $response = $this->response->create($content, $status, $headers);

        return $this->createOnly ? $response : $response->send();
    }
public function send($content, int $status = HttpResponse::HTTP_OK, array $headers = []) : HttpResponse
    {
        $headers = array_merge($this->headers, $headers);

        if (is_array($content)) {
            $content = json_encode($content);
        }

        $response = $this->response->create($content, $status, $headers);

        return $this->createOnly ? $response : $response->send();
    }
public function send ( $ content , int $ status = HttpResponse :: HTTP_OK , array $ headers = [ ] ) : HttpResponse { $ headers = array_merge ( $ this -> headers , $ headers ) ; if ( is_array ( $ content ) ) { $ content = json_encode ( $ content ) ; } $ response = $ this -> response -> create ( $ content , $ status , $ headers ) ; return $ this -> createOnly ? $ response : $ response -> send ( ) ; }
Create and send a response.

@param mixed $content Response data.
@param int   $status  Http status code.
@param array $headers Headers.

@return HttpResponse
Create and send a response .