NotificationException::getPid()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 4
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 0
1
<?php
2
/*
3
 * This file is part of the Pomm's Foundation package.
4
 *
5
 * (c) 2014 - 2017 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 - 2017 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
     * @param  array $notification
34
     */
35
    public function __construct(array $notification)
36
    {
37
        $this->channel = $notification['message'];
38
        $this->pid     = $notification['pid'];
39
        $this->message = $notification['payload'];
40
    }
41
42
    /**
43
     * getChannel
44
     *
45
     * Return the channel's name.
46
     *
47
     * @return string
48
     */
49
    public function getChannel()
50
    {
51
        return $this->channel;
52
    }
53
54
    /**
55
     * getPid
56
     *
57
     * Return the server's PID.
58
     *
59
     * @return string
60
     */
61
    public function getPid()
62
    {
63
        return $this->pid;
64
    }
65
}
66