Exception   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 30
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
wmc 2
eloc 6
dl 0
loc 30
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A getErrorList() 0 3 1
A __construct() 0 5 1
1
<?php
2
3
/**
4
 * @license LGPLv3, http://opensource.org/licenses/LGPL-3.0
5
 * @copyright Metaways Infosystems GmbH, 2012
6
 * @copyright Aimeos (aimeos.org), 2015-2025
7
 * @package Controller
8
 * @subpackage Frontend
9
 */
10
11
12
namespace Aimeos\Controller\Frontend;
13
14
15
/**
16
 * Common exception for frontend controller classes.
17
 *
18
 * @package Controller
19
 * @subpackage Frontend
20
 */
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
49
	{
50
		return $this->list;
51
	}
52
}
53