Completed
Push — master ( 0a059e...292010 )
by John
02:21
created

APIResponse::getMIMEType()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 3
ccs 2
cts 2
cp 1
rs 10
c 0
b 0
f 0
cc 1
eloc 2
nc 1
nop 0
crap 1
1
<?php
2
namespace LunixREST\Server\APIResponse;
3
4
use Psr\Http\Message\StreamInterface;
5
6
/**
7
 * An immutable data class representing a response to an APIRequest generated by an RequestFactory from APIRequestData.
8
 * Class APIResponse
9
 * @package LunixREST\Server\APIResponse
10
 */
11
class APIResponse
12
{
13
    /**
14
     * @var string
15
     */
16
    protected $MIMEType;
17
    /**
18
     * @var StreamInterface
19
     */
20
    protected $stream;
21
22 3
    public function __construct(string $MIMEType, StreamInterface $stream)
23
    {
24 3
        $this->MIMEType = $MIMEType;
25 3
        $this->stream = $stream;
26 3
    }
27
28 3
    public function getMIMEType(): string {
29 3
        return $this->MIMEType;
30
    }
31
32
    /**
33
     * @return StreamInterface
34
     */
35 3
    public function getAsDataStream(): StreamInterface {
36 3
        return $this->stream;
37
    }
38
39
}
40