| Conditions | 3 |
| Paths | 2 |
| Total Lines | 13 |
| Code Lines | 6 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 4 |
| CRAP Score | 3.072 |
| Changes | 4 | ||
| Bugs | 1 | Features | 1 |
| 1 | <?php |
||
| 50 | 1 | public function getFields() |
|
| 51 | { |
||
| 52 | 1 | if ($this->statement->execute()) { |
|
| 53 | // Statement executed successfully |
||
| 54 | // Grab the first row to find keys |
||
| 55 | 1 | $row = $this->statement->fetch(\PDO::FETCH_ASSOC); |
|
| 56 | // Return field keys, or empty array no rows remain |
||
| 57 | 1 | return array_keys($row ? $row : []); |
|
| 58 | } else { |
||
| 59 | // If the statement errors return empty |
||
| 60 | return []; |
||
| 61 | } |
||
| 62 | } |
||
| 63 | |||
| 129 |