@@ -142,7 +142,7 @@ |
||
142 | 142 | } elseif (is_float($value)) { |
143 | 143 | // Convert to non-locale aware float to prevent possible commas |
144 | 144 | return sprintf('%F', $value); |
145 | - } elseif (is_array($value)) { |
|
145 | + } elseif (is_array($value)) { |
|
146 | 146 | // Supports MVA attributes |
147 | 147 | return '('.implode(',', $this->quoteArr($value)).')'; |
148 | 148 | } |
@@ -110,7 +110,7 @@ |
||
110 | 110 | */ |
111 | 111 | public function key() |
112 | 112 | { |
113 | - return (int)$this->cursor; |
|
113 | + return (int) $this->cursor; |
|
114 | 114 | } |
115 | 115 | |
116 | 116 | /** |
@@ -124,7 +124,7 @@ discard block |
||
124 | 124 | * (PHP 5 >= 5.0.0)<br/> |
125 | 125 | * Return the key of the current element |
126 | 126 | * @link http://php.net/manual/en/iterator.key.php |
127 | - * @return mixed scalar on success, or null on failure. |
|
127 | + * @return integer scalar on success, or null on failure. |
|
128 | 128 | */ |
129 | 129 | public function key() |
130 | 130 | { |
@@ -180,7 +180,7 @@ discard block |
||
180 | 180 | * (PHP 5 >= 5.0.0)<br/> |
181 | 181 | * Return the current element |
182 | 182 | * @link http://php.net/manual/en/iterator.current.php |
183 | - * @return mixed Can return any type. |
|
183 | + * @return ResultSetInterface|null Can return any type. |
|
184 | 184 | */ |
185 | 185 | public function current() |
186 | 186 | { |
@@ -623,7 +623,7 @@ |
||
623 | 623 | } elseif (is_array($option['value'])) { |
624 | 624 | array_walk( |
625 | 625 | $option['value'], |
626 | - function (&$val, $key) { |
|
626 | + function(&$val, $key) { |
|
627 | 627 | $val = $key.'='.$val; |
628 | 628 | } |
629 | 629 | ); |
@@ -182,7 +182,7 @@ |
||
182 | 182 | * (PHP 5 >= 5.0.0)<br/> |
183 | 183 | * Return the key of the current element |
184 | 184 | * @link http://php.net/manual/en/iterator.key.php |
185 | - * @return mixed scalar on success, or null on failure. |
|
185 | + * @return integer scalar on success, or null on failure. |
|
186 | 186 | */ |
187 | 187 | public function key() |
188 | 188 | { |
@@ -110,7 +110,7 @@ |
||
110 | 110 | */ |
111 | 111 | public function key() |
112 | 112 | { |
113 | - return (int)$this->cursor; |
|
113 | + return (int) $this->cursor; |
|
114 | 114 | } |
115 | 115 | |
116 | 116 | /** |
@@ -46,7 +46,7 @@ |
||
46 | 46 | $fields = array(); |
47 | 47 | |
48 | 48 | for ($i = 0; $i < $this->statement->columnCount(); $i++) { |
49 | - $fields[] = (object)$this->statement->getColumnMeta($i); |
|
49 | + $fields[] = (object) $this->statement->getColumnMeta($i); |
|
50 | 50 | } |
51 | 51 | |
52 | 52 | return $fields; |
@@ -142,7 +142,7 @@ |
||
142 | 142 | $query .= $name.' '; |
143 | 143 | |
144 | 144 | // user variables must always be processed as arrays |
145 | - if ($user_var && ! is_array($value)) { |
|
145 | + if ($user_var && !is_array($value)) { |
|
146 | 146 | $query .= '= ('.$this->connection->quote($value).')'; |
147 | 147 | } elseif (is_array($value)) { |
148 | 148 | $query .= '= ('.implode(', ', $this->connection->quoteArr($value)).')'; |
@@ -38,8 +38,7 @@ |
||
38 | 38 | |
39 | 39 | try{ |
40 | 40 | $stm->execute(); |
41 | - } |
|
42 | - catch(\PDOException $exception){ |
|
41 | + } catch(\PDOException $exception){ |
|
43 | 42 | throw new DatabaseException($exception->getMessage() . ' [' . $query . ']'); |
44 | 43 | } |
45 | 44 |
@@ -27,11 +27,11 @@ discard block |
||
27 | 27 | |
28 | 28 | $stm = $this->connection->prepare($query); |
29 | 29 | |
30 | - try{ |
|
30 | + try { |
|
31 | 31 | $stm->execute(); |
32 | 32 | } |
33 | - catch(\PDOException $exception){ |
|
34 | - throw new DatabaseException($exception->getMessage() . ' [' . $query . ']'); |
|
33 | + catch (\PDOException $exception) { |
|
34 | + throw new DatabaseException($exception->getMessage().' ['.$query.']'); |
|
35 | 35 | } |
36 | 36 | |
37 | 37 | return new ResultSet($stm); |
@@ -46,17 +46,17 @@ discard block |
||
46 | 46 | |
47 | 47 | $dsn = 'mysql:'; |
48 | 48 | if (isset($params['host']) && $params['host'] != '') { |
49 | - $dsn .= 'host=' . $params['host'] . ';'; |
|
49 | + $dsn .= 'host='.$params['host'].';'; |
|
50 | 50 | } |
51 | 51 | if (isset($params['port'])) { |
52 | - $dsn .= 'port=' . $params['port'] . ';'; |
|
52 | + $dsn .= 'port='.$params['port'].';'; |
|
53 | 53 | } |
54 | 54 | if (isset($params['charset'])) { |
55 | - $dsn .= 'charset=' . $params['charset'] . ';'; |
|
55 | + $dsn .= 'charset='.$params['charset'].';'; |
|
56 | 56 | } |
57 | 57 | |
58 | 58 | if (isset($params['socket']) && $params['socket'] != '') { |
59 | - $dsn .= 'unix_socket=' . $params['socket'] . ';'; |
|
59 | + $dsn .= 'unix_socket='.$params['socket'].';'; |
|
60 | 60 | } |
61 | 61 | |
62 | 62 | try { |
@@ -99,7 +99,7 @@ discard block |
||
99 | 99 | try { |
100 | 100 | $statement = $this->connection->query(implode(';', $queue)); |
101 | 101 | } catch (\PDOException $exception) { |
102 | - throw new DatabaseException($exception->getMessage() .' [ '.implode(';', $queue).']'); |
|
102 | + throw new DatabaseException($exception->getMessage().' [ '.implode(';', $queue).']'); |
|
103 | 103 | } |
104 | 104 | |
105 | 105 | return new MultiResultSet($statement); |
@@ -45,7 +45,7 @@ |
||
45 | 45 | } |
46 | 46 | } |
47 | 47 | |
48 | - set_error_handler(function () {}); |
|
48 | + set_error_handler(function() {}); |
|
49 | 49 | try { |
50 | 50 | if (!$conn->real_connect($data['host'], null, null, null, (int) $data['port'], $data['socket'])) { |
51 | 51 | throw new ConnectionException('Connection Error: ['.$conn->connect_errno.']'.$conn->connect_error); |