| Total Complexity | 2 |
| Total Lines | 27 |
| Duplicated Lines | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 10 | class ExceptionWithContext extends \Exception |
||
| 11 | { |
||
| 12 | /** |
||
| 13 | * @var array |
||
| 14 | */ |
||
| 15 | private $context; |
||
| 16 | |||
| 17 | /** |
||
| 18 | * Construct a new instance of the exception. |
||
| 19 | * |
||
| 20 | * @param string $message The exception message. |
||
| 21 | * @param array $context Any local context information. |
||
| 22 | */ |
||
| 23 | public function __construct(string $message, array $context = [], int $code = 0, Throwable $previous = null) |
||
| 24 | { |
||
| 25 | parent::__construct($message, $code, $previous); |
||
| 26 | $this->context = $context; |
||
| 27 | } |
||
| 28 | |||
| 29 | /** |
||
| 30 | * Returns the specified context array associated with this exception. |
||
| 31 | * |
||
| 32 | * @return array |
||
| 33 | */ |
||
| 34 | public function getContext() : array |
||
| 37 | } |
||
| 38 | } |
||
| 39 |