Conditions | 4 |
Paths | 4 |
Total Lines | 14 |
Lines | 0 |
Ratio | 0 % |
Tests | 6 |
CRAP Score | 4.25 |
Changes | 0 |
1 | <?php |
||
58 | 2 | public function getCurrentSchema() |
|
59 | { |
||
60 | 2 | $query = 'SELECT DATABASE() as current_schema'; |
|
61 | try { |
||
62 | 2 | $results = $this->adapter->query($query); |
|
63 | 2 | if (count($results) == 0 || $results[0]['current_schema'] === null) { |
|
64 | 2 | return false; |
|
65 | } |
||
66 | } catch (\Exception $e) { |
||
67 | throw new Exception\RuntimeException($e->getMessage()); |
||
68 | } |
||
69 | |||
70 | 2 | return $results[0]['current_schema']; |
|
71 | } |
||
72 | } |
||
73 |