public function send($data, $code = 200, array $headers = [])
    {
        if (is_array($data) || $data instanceof \stdClass || is_object($data)) {
            return $this->json($data, $code, $headers);
        }

        $this->code = $code;

        foreach ($headers as $key => $value) {
            $this->addHeader($key, $value);
        }

        $this->content = $data;

        return $this->buildHttpResponse();
    }
public function send($data, $code = 200, array $headers = [])
    {
        if (is_array($data) || $data instanceof \stdClass || is_object($data)) {
            return $this->json($data, $code, $headers);
        }

        $this->code = $code;

        foreach ($headers as $key => $value) {
            $this->addHeader($key, $value);
        }

        $this->content = $data;

        return $this->buildHttpResponse();
    }
public function send ( $ data , $ code = 200 , array $ headers = [ ] ) { if ( is_array ( $ data ) || $ data instanceof \ stdClass || is_object ( $ data ) ) { return $ this -> json ( $ data , $ code , $ headers ) ; } $ this -> code = $ code ; foreach ( $ headers as $ key => $ value ) { $ this -> addHeader ( $ key , $ value ) ; } $ this -> content = $ data ; return $ this -> buildHttpResponse ( ) ; }
Equivalent to an echo, except that it ends the application

@param  string|array|\stdClass $data
@param  int  $code
@param  array  $headers
@return string
Equivalent to an echo except that it ends the application