Completed
Push — 2.0 ( 143803...4e64fa )
by grégoire
08:42 queued 04:22
created

NotificationException   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 46
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

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

3 Methods

Rating   Name   Duplication   Size   Complexity  
A getChannel() 0 4 1
A getPid() 0 4 1
A __construct() 0 6 1
1
<?php
2
/*
3
 * This file is part of the Pomm's Foundation package.
4
 *
5
 * (c) 2014 - 2015 Grégoire HUBERT <[email protected]>
6
 *
7
 * For the full copyright and license information, please view the LICENSE
8
 * file that was distributed with this source code.
9
 */
10
namespace PommProject\Foundation\Exception;
11
12
/**
13
 * NotificationException
14
 *
15
 * Notification exception.
16
 *
17
 * @package   Foundation
18
 * @copyright 2014 - 2015 Grégoire HUBERT
19
 * @author    Grégoire HUBERT
20
 * @license   X11 {@link http://opensource.org/licenses/mit-license.php}
21
 * @see       FoundationException
22
 */
23
class NotificationException extends FoundationException
24
{
25
    protected $channel;
26
    protected $pid;
27
28
    /**
29
     * __construct
30
     *
31
     * Exception constructor.
32
     *
33
     * @access public
34
     * @param  array $notification
35
     */
36
    public function __construct(array $notification)
37
    {
38
        $this->channel = $notification['message'];
39
        $this->pid     = $notification['pid'];
40
        $this->message = $notification['payload'];
41
    }
42
43
    /**
44
     * getChannel
45
     *
46
     * Return the channel's name.
47
     *
48
     * @access public
49
     * @return string
50
     */
51
    public function getChannel()
52
    {
53
        return $this->channel;
54
    }
55
56
    /**
57
     * getPid
58
     *
59
     * Return the server's PID.
60
     *
61
     * @access public
62
     * @return string
63
     */
64
    public function getPid()
65
    {
66
        return $this->pid;
67
    }
68
}
69