| Total Complexity | 3 |
| Total Lines | 34 |
| Duplicated Lines | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 10 | class PaystackException extends Exception |
||
| 11 | { |
||
| 12 | /** @var array<string, mixed> */ |
||
| 13 | protected array $context = []; |
||
| 14 | |||
| 15 | /** |
||
| 16 | * @param array<string, mixed> $context |
||
| 17 | */ |
||
| 18 | public function __construct( |
||
| 19 | string $message = '', |
||
| 20 | int $code = 0, |
||
| 21 | ?Exception $previous = null, |
||
| 22 | array $context = [] |
||
| 23 | ) { |
||
| 24 | parent::__construct($message, $code, $previous); |
||
| 25 | $this->context = $context; |
||
| 26 | } |
||
| 27 | |||
| 28 | /** |
||
| 29 | * @return array<string, mixed> |
||
| 30 | */ |
||
| 31 | public function getContext(): array |
||
| 32 | { |
||
| 33 | return $this->context; |
||
| 34 | } |
||
| 35 | |||
| 36 | /** |
||
| 37 | * @param array<string, mixed> $context |
||
| 38 | */ |
||
| 39 | public function setContext(array $context): self |
||
| 44 | } |
||
| 45 | } |
||
| 46 |