Completed
Push — master ( 8d892a...1ee813 )
by John
02:08
created

APIResponse::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 4
CRAP Score 1

Importance

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