for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace LunixREST\Server\APIResponse;
use Psr\Http\Message\StreamInterface;
/**
* An immutable data class representing a response to an APIRequest generated by an RequestFactory from APIRequestData.
* Class APIResponse
* @package LunixREST\Server\APIResponse
*/
class APIResponse
{
* @var string
protected $MIMEType;
* @var StreamInterface
protected $stream;
public function __construct(string $MIMEType, StreamInterface $stream)
$this->MIMEType = $MIMEType;
$this->stream = $stream;
}
public function getMIMEType(): string {
return $this->MIMEType;
* @return StreamInterface
public function getAsDataStream(): StreamInterface {
return $this->stream;