Completed
Pull Request — master (#16)
by Timo
03:16
created

UnknownTopicException::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 1
Metric Value
c 1
b 0
f 1
dl 0
loc 6
rs 9.4285
cc 1
eloc 3
nc 1
nop 1
1
<?php
2
3
4
namespace Tidal\WampWatch\Exception;
5
6
7
class UnknownTopicException extends \OutOfBoundsException
8
{
9
10
    /**
11
     * @var string name of the topic
12
     */
13
    protected $topicName;
14
15
    /**
16
     * @param string $topicName
17
     */
18
    public function __construct($topicName)
19
    {
20
        $this->setTopicName($topicName);
21
22
        parent::__construct("unknown topic '$topicName'");
23
    }
24
25
    /**
26
     * @param string $topicName
27
     */
28
    protected function setTopicName($topicName)
29
    {
30
        $this->topicName = $topicName;
31
    }
32
33
    /**
34
     * @return string the topic name
35
     */
36
    public function getTopicName()
37
    {
38
        return $this->topicName;
39
    }
40
}