Completed
Push — master ( dac9d4...d53965 )
by Timo
38s
created

UnknownTopicException::setTopicName()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 1
Metric Value
c 1
b 0
f 1
dl 0
loc 4
rs 10
cc 1
eloc 2
nc 1
nop 1
1
<?php
2
3
/*
4
 * This file is part of the Tidal/WampWatch package.
5
 *   (c) 2016 Timo Michna <timomichna/yahoo.de>
6
 *
7
 *  For the full copyright and license information, please view the LICENSE
8
 *  file that was distributed with this source code.
9
 */
10
11
namespace Tidal\WampWatch\Exception;
12
13
class UnknownTopicException extends \OutOfBoundsException
14
{
15
    /**
16
     * @var string name of the topic
17
     */
18
    protected $topicName;
19
20
    /**
21
     * @param string $topicName
22
     */
23
    public function __construct($topicName)
24
    {
25
        $this->setTopicName($topicName);
26
27
        parent::__construct("unknown topic '$topicName'");
28
    }
29
30
    /**
31
     * @param string $topicName
32
     */
33
    protected function setTopicName($topicName)
34
    {
35
        $this->topicName = $topicName;
36
    }
37
38
    /**
39
     * @return string the topic name
40
     */
41
    public function getTopicName()
42
    {
43
        return $this->topicName;
44
    }
45
}
46