Total Complexity | 4 |
Total Lines | 57 |
Duplicated Lines | 0 % |
Coverage | 100% |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
10 | class ListQueryException extends ListException |
||
11 | { |
||
12 | /** |
||
13 | * @var string |
||
14 | */ |
||
15 | private $ormError; |
||
16 | |||
17 | /** |
||
18 | * @var string |
||
19 | */ |
||
20 | private $dql; |
||
21 | |||
22 | /** |
||
23 | * ListQueryException constructor. |
||
24 | * |
||
25 | * @param string $ormError error message that is thrown by ORM |
||
26 | * @param string $dql DQL that is built |
||
27 | * @param string $message |
||
28 | * @param int $code |
||
29 | * @param Throwable|null $previous |
||
30 | */ |
||
31 | 6 | public function __construct(string $ormError, string $dql, $message = '', $code = 500, Throwable $previous = null) |
|
36 | } |
||
37 | |||
38 | /** |
||
39 | * @param string $ormError |
||
40 | * @param string $dql |
||
41 | * |
||
42 | * @return ListException |
||
43 | */ |
||
44 | 4 | public static function invalidQueryConfiguration(string $ormError, string $dql): ListException |
|
45 | { |
||
46 | 4 | return new self( |
|
47 | 4 | $ormError, |
|
48 | 4 | $dql, |
|
49 | 4 | sprintf('Query error: %s. DQL: %s', $ormError, $dql) |
|
50 | 4 | ); |
|
51 | } |
||
52 | |||
53 | /** |
||
54 | * @return string |
||
55 | */ |
||
56 | 1 | public function getOrmError(): string |
|
59 | } |
||
60 | |||
61 | /** |
||
62 | * @return string |
||
63 | */ |
||
64 | 1 | public function getDql(): string |
|
69 |