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

APIResponse   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 29
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 3
lcom 0
cbo 0
dl 0
loc 29
ccs 8
cts 8
cp 1
rs 10
c 0
b 0
f 0

3 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 5 1
A getMIMEType() 0 3 1
A getAsDataStream() 0 3 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