@@ -12,7 +12,7 @@ discard block |
||
12 | 12 | $new = ''; |
13 | 13 | $par = array_values($par); |
14 | 14 | if (substr_count($sql, '?') === 2 && !is_array($par[0])) { |
15 | - $par = [ $par ]; |
|
15 | + $par = [$par]; |
|
16 | 16 | } |
17 | 17 | $parts = explode('??', $sql); |
18 | 18 | $index = 0; |
@@ -22,7 +22,7 @@ discard block |
||
22 | 22 | $index += count($tmp) - 1; |
23 | 23 | if (isset($par[$index])) { |
24 | 24 | if (!is_array($par[$index])) { |
25 | - $par[$index] = [ $par[$index] ]; |
|
25 | + $par[$index] = [$par[$index]]; |
|
26 | 26 | } |
27 | 27 | $params = $par[$index]; |
28 | 28 | array_splice($par, $index, 1, $params); |
@@ -30,7 +30,7 @@ discard block |
||
30 | 30 | $new .= implode(',', array_fill(0, count($params), '?')); |
31 | 31 | } |
32 | 32 | } |
33 | - return [ $new, $par ]; |
|
33 | + return [$new, $par]; |
|
34 | 34 | } |
35 | 35 | /** |
36 | 36 | * Run a query (prepare & execute). |
@@ -62,7 +62,7 @@ |
||
62 | 62 | } |
63 | 63 | public function next() |
64 | 64 | { |
65 | - $this->fetched ++; |
|
65 | + $this->fetched++; |
|
66 | 66 | $this->last = $this->statement->fetchArray(\SQLITE3_ASSOC); |
67 | 67 | } |
68 | 68 | public function valid() |
@@ -67,7 +67,7 @@ |
||
67 | 67 | } |
68 | 68 | public function next() |
69 | 69 | { |
70 | - $this->fetched ++; |
|
70 | + $this->fetched++; |
|
71 | 71 | $this->last = \ibase_fetch_assoc($this->result, \IBASE_TEXT); |
72 | 72 | } |
73 | 73 | public function valid() |
@@ -52,7 +52,7 @@ |
||
52 | 52 | $this->connect(); |
53 | 53 | $statement = \ibase_prepare($this->transaction !== null ? $this->transaction : $this->lnk, $sql); |
54 | 54 | if ($statement === false) { |
55 | - throw new DBException('Prepare error: ' . \ibase_errmsg()); |
|
55 | + throw new DBException('Prepare error: '.\ibase_errmsg()); |
|
56 | 56 | } |
57 | 57 | return new Statement( |
58 | 58 | $statement, |
@@ -55,7 +55,7 @@ |
||
55 | 55 | } |
56 | 56 | public function next() |
57 | 57 | { |
58 | - $this->fetched ++; |
|
58 | + $this->fetched++; |
|
59 | 59 | $this->last = $this->statement->fetch(\PDO::FETCH_ASSOC); |
60 | 60 | } |
61 | 61 | public function valid() |
@@ -44,7 +44,7 @@ |
||
44 | 44 | isset($this->connection['opts']) ? $this->connection['opts'] : [] |
45 | 45 | ); |
46 | 46 | } catch (\PDOException $e) { |
47 | - throw new DBException('Connect error: ' . $e->getMessage()); |
|
47 | + throw new DBException('Connect error: '.$e->getMessage()); |
|
48 | 48 | } |
49 | 49 | } |
50 | 50 | } |
@@ -74,7 +74,7 @@ |
||
74 | 74 | } |
75 | 75 | public function next() |
76 | 76 | { |
77 | - $this->fetched ++; |
|
77 | + $this->fetched++; |
|
78 | 78 | $temp = \odbc_fetch_row($this->statement); |
79 | 79 | if (!$temp) { |
80 | 80 | $this->last = false; |
@@ -51,7 +51,7 @@ |
||
51 | 51 | $instance->setLength($data['length']); |
52 | 52 | } |
53 | 53 | if ($instance->getBasicType() === 'enum' && strpos($instance->getType(), 'enum(') === 0) { |
54 | - $temp = array_map(function ($v) { |
|
54 | + $temp = array_map(function($v) { |
|
55 | 55 | return str_replace("''", "'", $v); |
56 | 56 | }, explode("','", substr($instance->getType(), 6, -2))); |
57 | 57 | $instance->setValues($temp); |
@@ -24,28 +24,28 @@ |
||
24 | 24 | foreach ($data as $i => $v) { |
25 | 25 | switch (gettype($v)) { |
26 | 26 | case 'boolean': |
27 | - $this->statement->bindValue($i+1, $v, \PDO::PARAM_BOOL); |
|
27 | + $this->statement->bindValue($i + 1, $v, \PDO::PARAM_BOOL); |
|
28 | 28 | break; |
29 | 29 | case 'integer': |
30 | - $this->statement->bindValue($i+1, $v, \PDO::PARAM_INT); |
|
30 | + $this->statement->bindValue($i + 1, $v, \PDO::PARAM_INT); |
|
31 | 31 | break; |
32 | 32 | case 'NULL': |
33 | - $this->statement->bindValue($i+1, $v, \PDO::PARAM_NULL); |
|
33 | + $this->statement->bindValue($i + 1, $v, \PDO::PARAM_NULL); |
|
34 | 34 | break; |
35 | 35 | case 'double': |
36 | - $this->statement->bindValue($i+1, $v); |
|
36 | + $this->statement->bindValue($i + 1, $v); |
|
37 | 37 | break; |
38 | 38 | default: |
39 | 39 | // keep in mind oracle needs a transaction when inserting LOBs, aside from the specific syntax: |
40 | 40 | // INSERT INTO table (column, lobcolumn) VALUES (?, ?, EMPTY_BLOB()) RETURNING lobcolumn INTO ? |
41 | 41 | if (is_resource($v) && get_resource_type($v) === 'stream') { |
42 | - $this->statement->bindParam($i+1, $v, \PDO::PARAM_LOB); |
|
42 | + $this->statement->bindParam($i + 1, $v, \PDO::PARAM_LOB); |
|
43 | 43 | break; |
44 | 44 | } |
45 | 45 | if (!is_string($data[$i])) { |
46 | 46 | $data[$i] = serialize($data[$i]); |
47 | 47 | } |
48 | - $this->statement->bindValue($i+1, $v); |
|
48 | + $this->statement->bindValue($i + 1, $v); |
|
49 | 49 | break; |
50 | 50 | } |
51 | 51 | } |