Passed
Branch 1.0 (f7255b)
by Vladimir
06:00
created

Chat   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 46
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 4
lcom 0
cbo 0
dl 0
loc 46
ccs 11
cts 11
cp 1
rs 10
c 0
b 0
f 0

4 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 6 1
A getId() 0 4 1
A getTitle() 0 4 1
A getType() 0 4 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace FondBot\Drivers;
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 1
    public function __construct(string $id, string $title, string $type = self::TYPE_PRIVATE)
17
    {
18 1
        $this->id = $id;
19 1
        $this->title = $title;
20 1
        $this->type = $type;
21 1
    }
22
23
    /**
24
     * Get chat identifier.
25
     *
26
     * @return string
27
     */
28 1
    public function getId(): string
29
    {
30 1
        return $this->id;
31
    }
32
33
    /**
34
     * Get title of the chat.
35
     *
36
     * @return string
37
     */
38 1
    public function getTitle(): string
39
    {
40 1
        return $this->title;
41
    }
42
43
    /**
44
     * Get type of the chat.
45
     *
46
     * @return string
47
     */
48 1
    public function getType(): string
49
    {
50 1
        return $this->type;
51
    }
52
}
53