Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
Total | |
33.33% |
1 / 3 |
|
50.00% |
1 / 2 |
CRAP | |
0.00% |
0 / 1 |
storage_exception | |
33.33% |
1 / 3 |
|
50.00% |
1 / 2 |
3.19 | |
0.00% |
0 / 1 |
__construct | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
get_filename | |
0.00% |
0 / 2 |
|
0.00% |
0 / 1 |
2 |
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\storage\exception; |
15 | |
16 | use phpbb\exception\runtime_exception; |
17 | |
18 | class storage_exception extends runtime_exception |
19 | { |
20 | /** |
21 | * Constructor |
22 | * |
23 | * @param string $message The Exception message to throw (must be a language variable) |
24 | * @param string $filename The file that caused the error |
25 | * @param array $parameters The parameters to use with the language var |
26 | * @param \Exception|null $previous The previous runtime_exception used for the runtime_exception chaining |
27 | * @param integer $code The Exception code |
28 | */ |
29 | public function __construct($message = '', $filename = '', $parameters = [], \Exception $previous = null, $code = 0) |
30 | { |
31 | parent::__construct($message, array_merge(array('filename' => $filename), $parameters), $previous, $code); |
32 | } |
33 | |
34 | /** |
35 | * Returns the filename that triggered the error |
36 | * |
37 | * @return string |
38 | */ |
39 | public function get_filename() |
40 | { |
41 | $parameters = $this->get_parameters(); |
42 | return $parameters['filename']; |
43 | } |
44 | } |