| Total Complexity | 6 |
| Total Lines | 67 |
| Duplicated Lines | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 10 | class Statement implements StatementInterface |
||
| 11 | { |
||
| 12 | /** |
||
| 13 | * The query result |
||
| 14 | * |
||
| 15 | * @var SQLite3Result |
||
| 16 | */ |
||
| 17 | protected $result = null; |
||
| 18 | |||
| 19 | /** |
||
| 20 | * Undocumented variable |
||
| 21 | * |
||
| 22 | * @var int |
||
| 23 | */ |
||
| 24 | protected $offset = 0; |
||
| 25 | |||
| 26 | /** |
||
| 27 | * The constructor |
||
| 28 | * |
||
| 29 | * @param SQLite3Result $result |
||
| 30 | */ |
||
| 31 | public function __construct(SQLite3Result $result) |
||
| 32 | { |
||
| 33 | $this->result = $result; |
||
| 34 | } |
||
| 35 | |||
| 36 | /** |
||
| 37 | * @inheritDoc |
||
| 38 | */ |
||
| 39 | public function rowCount() |
||
| 40 | { |
||
| 41 | return $this->result->numColumns(); |
||
| 42 | } |
||
| 43 | |||
| 44 | /** |
||
| 45 | * @inheritDoc |
||
| 46 | */ |
||
| 47 | public function fetchAssoc() |
||
| 48 | { |
||
| 49 | return $this->result->fetchArray(SQLITE3_ASSOC); |
||
| 50 | } |
||
| 51 | |||
| 52 | /** |
||
| 53 | * @inheritDoc |
||
| 54 | */ |
||
| 55 | public function fetchRow() |
||
| 56 | { |
||
| 57 | return $this->result->fetchArray(SQLITE3_NUM); |
||
| 58 | } |
||
| 59 | |||
| 60 | /** |
||
| 61 | * @inheritDoc |
||
| 62 | */ |
||
| 63 | public function fetchField() |
||
| 69 | } |
||
| 70 | |||
| 71 | /** |
||
| 72 | * The destructor |
||
| 73 | */ |
||
| 74 | public function __destruct() |
||
| 77 | } |
||
| 78 | } |
||
| 79 |
In the issue above, the returned value is violating the contract defined by the mentioned interface.
Let's take a look at an example: