Completed
Push — master ( 41473f...a7f28d )
by Vladimir
02:31
created

Chat::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 5
CRAP Score 1

Importance

Changes 0
Metric Value
cc 1
eloc 4
nc 1
nop 3
dl 0
loc 6
ccs 5
cts 5
cp 1
crap 1
rs 9.4285
c 0
b 0
f 0
1
<?php
2
3
declare(strict_types=1);
4
5
namespace FondBot\Channels;
6
7
class Chat
8
{
9
    public const TYPE_PRIVATE = 'private';
10
    public const TYPE_GROUP = 'group';
11
12
    private $id;
13
    private $title;
14
    private $type;
15
16 27
    public function __construct(string $id, string $title = null, string $type = self::TYPE_PRIVATE)
17
    {
18 27
        $this->id = $id;
19 27
        $this->title = $title;
20 27
        $this->type = $type;
21 27
    }
22
23
    public static function create(string $id, string $title = null, string $type = self::TYPE_PRIVATE)
24
    {
25
        return new static($id, $title, $type);
26
    }
27
28 1
    public function getId(): string
29
    {
30 1
        return $this->id;
31
    }
32
33 1
    public function getTitle(): ?string
34
    {
35 1
        return $this->title;
36
    }
37
38 1
    public function getType(): string
39
    {
40 1
        return $this->type;
41
    }
42
}
43