| Total Complexity | 13 |
| Total Lines | 64 |
| Duplicated Lines | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 12 | class Statement implements StatementInterface |
||
| 13 | { |
||
| 14 | /** |
||
| 15 | * The query result |
||
| 16 | * |
||
| 17 | * @var mysqli_result |
||
| 18 | */ |
||
| 19 | protected $result = null; |
||
| 20 | |||
| 21 | /** |
||
| 22 | * The constructor |
||
| 23 | * |
||
| 24 | * @param mysqli_result|bool $result |
||
| 25 | */ |
||
| 26 | public function __construct($result) |
||
| 27 | { |
||
| 28 | if (is_a($result, mysqli_result::class)) { |
||
| 29 | $this->result = $result; |
||
| 30 | } |
||
| 31 | } |
||
| 32 | |||
| 33 | /** |
||
| 34 | * @inheritDoc |
||
| 35 | */ |
||
| 36 | public function rowCount() |
||
| 37 | { |
||
| 38 | return $this->result ? $this->result->num_rows : 0; |
||
| 39 | } |
||
| 40 | |||
| 41 | /** |
||
| 42 | * @inheritDoc |
||
| 43 | */ |
||
| 44 | public function fetchAssoc() |
||
| 45 | { |
||
| 46 | return ($this->result) ? $this->result->fetch_assoc() : null; |
||
| 47 | } |
||
| 48 | |||
| 49 | /** |
||
| 50 | * @inheritDoc |
||
| 51 | */ |
||
| 52 | public function fetchRow() |
||
| 55 | } |
||
| 56 | |||
| 57 | /** |
||
| 58 | * @inheritDoc |
||
| 59 | */ |
||
| 60 | public function fetchField() |
||
| 67 | } |
||
| 68 | |||
| 69 | /** |
||
| 70 | * The destructor |
||
| 71 | */ |
||
| 72 | public function __destruct() |
||
| 76 | } |
||
| 77 | } |
||
| 79 |