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

UnknownTopicException   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 34
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

Changes 1
Bugs 0 Features 1
Metric Value
wmc 3
c 1
b 0
f 1
lcom 0
cbo 0
dl 0
loc 34
rs 10

3 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 6 1
A setTopicName() 0 4 1
A getTopicName() 0 4 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
}