Skip to content
This repository has been archived by the owner on Feb 5, 2019. It is now read-only.

Commit

Permalink
new method StreamResponse::getRawResource()
Browse files Browse the repository at this point in the history
  • Loading branch information
Joan Fabrégat committed Jul 27, 2018
1 parent bf35b7b commit 69742e7
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions src/StreamResponse.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,11 @@ class StreamResponse extends Response
*/
private $stream;

/**
* @var mixed
*/
private $rawResource;

/**
* @var null|string
*/
Expand Down Expand Up @@ -78,6 +83,7 @@ public function __construct($resource, ?string $charset = null, ?int $contentLen
?string $fileName = null, bool $asAttachment = false, int $status = 200, array $headers = [],
string $version = '1.1', ?string $reason = null)
{
$this->rawResource = $resource;
$this->stream = stream_for($resource);
$this->charset = $charset;
$this->contentLength = $contentLength;
Expand Down Expand Up @@ -109,6 +115,16 @@ public function getStream():StreamInterface
return $this->stream;
}

/**
* Returns the raw resource as passed to the constructor.
*
* @return mixed
*/
public function getRawResource()
{
return $this->rawResource;
}

/**
* Returns the mime type if set or null.
*
Expand Down

0 comments on commit 69742e7

Please sign in to comment.