Conditions | 4 |
Paths | 4 |
Total Lines | 13 |
Code Lines | 9 |
Lines | 0 |
Ratio | 0 % |
Tests | 7 |
CRAP Score | 4.0313 |
Changes | 2 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
25 | 2 | public function getCurrentSchema() |
|
26 | { |
||
27 | 2 | $query = 'SELECT DATABASE() as current_schema'; |
|
28 | try { |
||
29 | 2 | $results = $this->query($query); |
|
30 | 2 | if (count($results) == 0 || $results[0]['current_schema'] === null) { |
|
31 | 2 | return false; |
|
32 | } |
||
33 | 2 | } catch (\Exception $e) { |
|
34 | throw new Exception\RuntimeException($e->getMessage()); |
||
35 | } |
||
36 | 2 | return $results[0]['current_schema']; |
|
37 | } |
||
38 | } |
||
39 |