Response::getMessage()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
cc 1
eloc 1
nc 1
nop 0
dl 0
loc 3
ccs 2
cts 2
cp 1
crap 1
rs 10
c 0
b 0
f 0
1
<?php declare(strict_types=1);
2
3
namespace Gockets\Model;
4
5
/**
6
 * Basic server response
7
 */
8
final class Response
9
{
10
    private $success;
11
12
    private $type;
13
14
    private $message;
15
16 6
    public function __construct(string $type, string $message)
17
    {
18 6
        $this->success = $type !== 'ERR';
19 6
        $this->type = $type;
20 6
        $this->message = $message;
21 6
    }
22
23
24 5
    public function getSuccess(): ?bool
25
    {
26 5
        return $this->success;
27
    }
28
29 5
    public function getType(): string
30
    {
31 5
        return $this->type;
32
    }
33
34 5
    public function getMessage(): string
35
    {
36 5
        return $this->message;
37
    }
38
}
39