Exception::getErrors()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
eloc 1
dl 0
loc 3
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 0
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\Basket;
13
14
15
/**
16
 * \Exception for basket frontend controller classes.
17
 *
18
 * @package Controller
19
 * @subpackage Frontend
20
 */
21
class Exception extends \Aimeos\Controller\Frontend\Exception
22
{
23
	private array $errors;
24
25
26
	/**
27
	 * Initializes the instance of the exception
28
	 *
29
	 * @param string $message Custom error message to describe the error
30
	 * @param int $code Custom error code to identify or classify the error
31
	 * @param \Exception|null $previous Previously thrown exception
32
	 * @param array $errors List of error codes for error handling
33
	 */
34
	public function __construct( string $message = '', int $code = 0, ?\Exception $previous = null, array $errors = [] )
35
	{
36
		parent::__construct( $message, $code, $previous );
37
38
		$this->errors = $errors;
39
	}
40
41
42
	/**
43
	 * Gets the error codes of the exception
44
	 *
45
	 * @return array list of error codes
46
	 */
47
	public function getErrors() : array
48
	{
49
		return $this->errors;
50
	}
51
}
52