Total Complexity | 2 |
Total Lines | 30 |
Duplicated Lines | 0 % |
Changes | 0 |
1 | <?php |
||
21 | class Exception |
||
22 | extends \Exception |
||
23 | { |
||
24 | private array $list; |
||
25 | |||
26 | |||
27 | /** |
||
28 | * Initializes the exception. |
||
29 | * |
||
30 | * @param string $msg The exception message |
||
31 | * @param int $code The exception code |
||
32 | * @param \Exception $previous The previous exception used for the exception chaining. |
||
33 | * @param array $list The associative list of errors and their messages when several errors occured |
||
34 | */ |
||
35 | public function __construct( string $msg = '', int $code = 0, ?\Exception $previous = null, array $list = [] ) |
||
36 | { |
||
37 | parent::__construct( $msg, $code, $previous ); |
||
38 | |||
39 | $this->list = $list; |
||
40 | } |
||
41 | |||
42 | |||
43 | /** |
||
44 | * Returns the list of error messages. |
||
45 | * |
||
46 | * @return array Associative list of keys and their error messages |
||
47 | */ |
||
48 | public function getErrorList() : array |
||
51 | } |
||
52 | } |
||
53 |