UnknownTopicException::__construct()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
c 0
b 0
f 0
dl 0
loc 6
rs 9.4285
cc 1
eloc 3
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
12
namespace Tidal\WampWatch\Exception;
13
14
class UnknownTopicException extends \OutOfBoundsException
15
{
16
    /**
17
     * @var string name of the topic
18
     */
19
    protected $topicName;
20
21
    /**
22
     * @param string $topicName
23
     */
24
    public function __construct($topicName)
25
    {
26
        $this->setTopicName($topicName);
27
28
        parent::__construct("unknown topic '$topicName'");
29
    }
30
31
    /**
32
     * @param string $topicName
33
     */
34
    protected function setTopicName($topicName)
35
    {
36
        $this->topicName = $topicName;
37
    }
38
39
    /**
40
     * @return string the topic name
41
     */
42
    public function getTopicName()
43
    {
44
        return $this->topicName;
45
    }
46
}
47