src/Support/Http/Responses/ResponseStream.php
protected function chunk(array $data, bool $terminating): string
    {
        $json = json_encode($data, 0);
        $length = $terminating
            ? strlen($json)
            : strlen($json.self::EOL);

        $chunk = implode(self::EOL, [
            'Content-Type: application/json',
            'Content-Length: '.$length,
            null,
            $json,
            null,
        ]);

        return $this->boundary().$chunk;
    }
protected function chunk(array $data, bool $terminating): string
    {
        $json = json_encode($data, 0);
        $length = $terminating
            ? strlen($json)
            : strlen($json.self::EOL);

        $chunk = implode(self::EOL, [
            'Content-Type: application/json',
            'Content-Length: '.$length,
            null,
            $json,
            null,
        ]);

        return $this->boundary().$chunk;
    }
protected function chunk ( array $ data , bool $ terminating ) : string { $ json = json_encode ( $ data , 0 ) ; $ length = $ terminating ? strlen ( $ json ) : strlen ( $ json . self :: EOL ) ; $ chunk = implode ( self :: EOL , [ 'Content-Type: application/json' , 'Content-Length: ' . $ length , null , $ json , null , ] ) ; return $ this -> boundary ( ) . $ chunk ; }
Format chunked data.

@param  array  $data
@param  bool  $terminating
@return string
Format chunked data .