Completed
Push — master ( aeebc0...944ed2 )
by Jared
01:32
created

ListenerException::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 5
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 2
1
<?php
2
3
namespace Pulsar\Exception;
4
5
/**
6
 * An exception thrown by a model listener that also contains
7
 * the error message to be set on the model.
8
 */
9
class ListenerException extends ModelException
10
{
11
    /** @var array */
12
    private $context;
13
14
    /**
15
     * @param string $message the error message to be provided to the model
16
     * @param array  $context the context for the model error message
17
     */
18
    public function __construct(string $message, array $context = [])
19
    {
20
        parent::__construct($message);
21
        $this->context = $context;
22
    }
23
24
    public function getContext(): array
25
    {
26
        return $this->context;
27
    }
28
}
29