Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
Total | |
100.00% |
3 / 3 |
|
100.00% |
2 / 2 |
CRAP | |
100.00% |
1 / 1 |
runtime_exception | |
100.00% |
3 / 3 |
|
100.00% |
2 / 2 |
2 | |
100.00% |
1 / 1 |
__construct | |
100.00% |
2 / 2 |
|
100.00% |
1 / 1 |
1 | |||
get_parameters | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 |
1 | <?php |
2 | /** |
3 | * |
4 | * This file is part of the phpBB Forum Software package. |
5 | * |
6 | * @copyright (c) phpBB Limited <https://www.phpbb.com> |
7 | * @license GNU General Public License, version 2 (GPL-2.0) |
8 | * |
9 | * For full copyright and license information, please see |
10 | * the docs/CREDITS.txt file. |
11 | * |
12 | */ |
13 | |
14 | namespace phpbb\exception; |
15 | |
16 | /** |
17 | * Class runtime_exception |
18 | * |
19 | * Define an exception which support a language var as message. |
20 | */ |
21 | class runtime_exception extends \RuntimeException implements exception_interface |
22 | { |
23 | /** |
24 | * Parameters to use with the language var. |
25 | * |
26 | * @var array |
27 | */ |
28 | private $parameters; |
29 | |
30 | /** |
31 | * Constructor |
32 | * |
33 | * @param string $message The Exception message to throw (must be a language variable). |
34 | * @param array $parameters The parameters to use with the language var. |
35 | * @param \Exception|null $previous The previous runtime_exception used for the runtime_exception chaining. |
36 | * @param integer $code The Exception code. |
37 | */ |
38 | public function __construct($message = "", array $parameters = array(), \Exception $previous = null, $code = 0) |
39 | { |
40 | $this->parameters = $parameters; |
41 | |
42 | parent::__construct($message, $code, $previous); |
43 | } |
44 | |
45 | /** |
46 | * {@inheritdoc} |
47 | */ |
48 | public function get_parameters() |
49 | { |
50 | return $this->parameters; |
51 | } |
52 | } |