Conditions | 4 |
Paths | 5 |
Total Lines | 14 |
Code Lines | 10 |
Lines | 0 |
Ratio | 0 % |
Tests | 7 |
CRAP Score | 4.432 |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
20 | */ |
||
21 | 6 | public function query($query) |
|
22 | { |
||
23 | try { |
||
24 | 6 | $stmt = $this->resource->query($query, \PDO::FETCH_ASSOC); |
|
25 | 6 | if ($stmt === false) { |
|
26 | 3 | throw new Exception\InvalidArgumentException("Query cannot be executed [$query]."); |
|
27 | } |
||
28 | 6 | $results = new Resultset(); |
|
29 | 6 | foreach ($stmt as $row) { |
|
30 | 3 | $results->append($row); |
|
31 | 6 | } |
|
32 | 6 | } catch (Exception\InvalidArgumentException $e) { |
|
33 | 3 | throw $e; |
|
34 | } catch (\Exception $e) { |
||
64 |