Completed
Push — master ( 0e6f1b...69c814 )
by Brian
02:51
created

ChannelHold::getEventId()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 4
Ratio 100 %

Importance

Changes 0
Metric Value
dl 4
loc 4
rs 10
c 0
b 0
f 0
cc 1
eloc 2
nc 1
nop 0
1
<?php
2
/**
3
 * Created by Piskle.
4
 * Date: 8/22/16
5
 * Time: 3:00 PM
6
 */
7
8
namespace phparia\Events;
9
10
use phparia\Client\AriClient;
11
use phparia\Resources\Channel;
12
13
14 View Code Duplication
class ChannelHold extends Event implements IdentifiableEventInterface
0 ignored issues
show
Duplication introduced by
This class seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
15
{
16
    /**
17
     * @var Channel
18
     */
19
    private $channel;
20
21
    /**
22
     * @return Channel
23
     */
24
    public function getChannel()
25
    {
26
        return $this->channel;
27
    }
28
29
    public function getEventId()
30
    {
31
        return "{$this->getType()}_{$this->getChannel()->getId()}";
32
    }
33
34
    /**
35
     * @param AriClient $client
36
     * @param string $response
37
     */
38
    public function __construct(AriClient $client, $response)
39
    {
40
        parent::__construct($client, $response);
41
42
        $this->channel = $this->getResponseValue('channel', 'phparia\Resources\Channel', $client);
43
    }
44
}