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

ListenerException   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 20
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

Changes 0
Metric Value
wmc 2
lcom 0
cbo 1
dl 0
loc 20
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 5 1
A getContext() 0 4 1
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