| Conditions | 6 |
| Paths | 8 |
| Total Lines | 20 |
| Code Lines | 14 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 22 | public function execute(array $data = []) : ResultInterface |
||
| 23 | { |
||
| 24 | if (!is_array($data)) { |
||
| 25 | $data = array(); |
||
| 26 | } |
||
| 27 | $temp = \odbc_execute($this->statement, $data); |
||
| 28 | if (!$temp) { |
||
| 29 | throw new DBException('Could not execute query : '.\odbc_errormsg($this->driver)); |
||
| 30 | } |
||
| 31 | $iid = null; |
||
| 32 | if (preg_match('@^\s*(INSERT|REPLACE)\s+INTO@i', $this->sql)) { |
||
| 33 | $iid = \odbc_exec($this->driver, 'SELECT @@IDENTITY'); |
||
| 34 | if ($iid && \odbc_fetch_row($iid)) { |
||
| 35 | $iid = odbc_result($result, 1); |
||
|
|
|||
| 36 | } else { |
||
| 37 | $iid = null; |
||
| 38 | } |
||
| 39 | } |
||
| 40 | return new Result($this->statement, $data, $iid); |
||
| 41 | } |
||
| 42 | } |
This check marks access to variables or properties that have not been declared yet. While PHP has no explicit notion of declaring a variable, accessing it before a value is assigned to it is most likely a bug.