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

Response   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 29
Duplicated Lines 0 %

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
eloc 10
dl 0
loc 29
ccs 0
cts 17
cp 0
rs 10
c 0
b 0
f 0
wmc 4

4 Methods

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