AbstractChannel::getSystem()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
dl 0
loc 4
ccs 0
cts 4
cp 0
rs 10
c 0
b 0
f 0
cc 1
eloc 2
nc 1
nop 0
crap 2
1
<?php
2
/**
3
 * This file is part of Platform package.
4
 *
5
 * For the full copyright and license information, please view the LICENSE
6
 * file that was distributed with this source code.
7
 */
8
declare(strict_types=1);
9
10
namespace Karma\Platform\Io;
11
12
/**
13
 * Class AbstractChannel
14
 * @package Karma\Platform\Io
15
 */
16
abstract class AbstractChannel implements ChannelInterface
17
{
18
    /**
19
     * @var SystemInterface
20
     */
21
    protected $system;
22
23
    /**
24
     * @var string
25
     */
26
    protected $id;
27
28
    /**
29
     * @var string
30
     */
31
    protected $name;
32
33
    /**
34
     * GitterChannel constructor.
35
     * @param SystemInterface $system
36
     * @param string $id
37
     * @param string $name
38
     */
39
    public function __construct(SystemInterface $system, string $id, string $name)
40
    {
41
        $this->system = $system;
42
        $this->id = $id;
43
        $this->name = $name;
44
    }
45
46
    /**
47
     * @return array
48
     */
49
    public function __debugInfo()
50
    {
51
        return [
52
            'system' => $this->getSystem()->getName(),
53
            'id'     => $this->getId(),
54
            'name'   => $this->getName(),
55
        ];
56
    }
57
58
    /**
59
     * @return SystemInterface
60
     */
61
    public function getSystem(): SystemInterface
62
    {
63
        return $this->system;
64
    }
65
66
    /**
67
     * @return string
68
     */
69
    public function getId(): string
70
    {
71
        return $this->id;
72
    }
73
74
    /**
75
     * @return string
76
     */
77
    public function getName(): string
78
    {
79
        return $this->name;
80
    }
81
}
82