Completed
Push — master ( 1be44d...449b6f )
by Artem
02:21
created

Response::getSuccess()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
cc 1
eloc 1
nc 1
nop 0
dl 0
loc 3
ccs 0
cts 3
cp 0
crap 2
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
    public function __construct(string $type, string $message)
17
    {
18
        $this->success = $type !== 'ERR';
19
        $this->type = $type;
20
        $this->message = $message;
21
    }
22
23
24
    public function getSuccess(): ?bool
25
    {
26
        return $this->success;
27
    }
28
29
    public function getType(): string
30
    {
31
        return $this->type;
32
    }
33
34
    public function getMessage(): string
35
    {
36
        return $this->message;
37
    }
38
}
39