111
This commit is contained in:
@@ -23,6 +23,15 @@ class Response implements ResponseInterface, \Server\ResponseInterface
|
|||||||
const CONTENT_TYPE_XML = 'application/xml;charset=utf-8';
|
const CONTENT_TYPE_XML = 'application/xml;charset=utf-8';
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
public function __construct()
|
||||||
|
{
|
||||||
|
$this->stream = new Stream('');
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param string $type
|
* @param string $type
|
||||||
* @return $this
|
* @return $this
|
||||||
|
|||||||
@@ -133,13 +133,25 @@ class Stream implements StreamInterface
|
|||||||
*/
|
*/
|
||||||
public function write($string): int
|
public function write($string): int
|
||||||
{
|
{
|
||||||
// TODO: Implement write() method.
|
$this->body = $string;
|
||||||
|
$this->size = strlen($this->body);
|
||||||
|
return $this->size;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param string $string
|
||||||
|
* @return int
|
||||||
|
*/
|
||||||
|
public function append($string): int
|
||||||
|
{
|
||||||
$this->body .= $string;
|
$this->body .= $string;
|
||||||
$this->size = strlen($this->body);
|
$this->size = strlen($this->body);
|
||||||
return $this->size;
|
return $this->size;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return bool
|
* @return bool
|
||||||
*/
|
*/
|
||||||
@@ -155,7 +167,6 @@ class Stream implements StreamInterface
|
|||||||
*/
|
*/
|
||||||
public function read($length): string
|
public function read($length): string
|
||||||
{
|
{
|
||||||
// TODO: Implement read() method.
|
|
||||||
return substr($this->body, 0, $length);
|
return substr($this->body, 0, $length);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user