@@ -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 | /** |
@@ -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 | ); |
@@ -50,7 +50,7 @@ |
||
| 50 | 50 | } |
| 51 | 51 | } |
| 52 | 52 | |
| 53 | - if (!$suppress_error && ! $this->silence_connection_warning) { |
|
| 53 | + if (!$suppress_error && !$this->silence_connection_warning) { |
|
| 54 | 54 | $conn->real_connect($data['host'], null, null, null, (int) $data['port'], $data['socket']); |
| 55 | 55 | } else { |
| 56 | 56 | @ $conn->real_connect($data['host'], null, null, null, (int) $data['port'], $data['socket']); |
@@ -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; |
@@ -36,11 +36,11 @@ discard block |
||
| 36 | 36 | |
| 37 | 37 | $stm = $this->connection->prepare($query); |
| 38 | 38 | |
| 39 | - try{ |
|
| 39 | + try { |
|
| 40 | 40 | $stm->execute(); |
| 41 | 41 | } |
| 42 | - catch(\PDOException $exception){ |
|
| 43 | - throw new DatabaseException($exception->getMessage() . ' [' . $query . ']'); |
|
| 42 | + catch (\PDOException $exception) { |
|
| 43 | + throw new DatabaseException($exception->getMessage().' ['.$query.']'); |
|
| 44 | 44 | } |
| 45 | 45 | |
| 46 | 46 | return ResultSet::make($stm); |
@@ -56,17 +56,17 @@ discard block |
||
| 56 | 56 | |
| 57 | 57 | $dsn = 'mysql:'; |
| 58 | 58 | if (isset($params['host']) && $params['host'] != '') { |
| 59 | - $dsn .= 'host=' . $params['host'] . ';'; |
|
| 59 | + $dsn .= 'host='.$params['host'].';'; |
|
| 60 | 60 | } |
| 61 | 61 | if (isset($params['port'])) { |
| 62 | - $dsn .= 'port=' . $params['port'] . ';'; |
|
| 62 | + $dsn .= 'port='.$params['port'].';'; |
|
| 63 | 63 | } |
| 64 | 64 | if (isset($params['charset'])) { |
| 65 | - $dsn .= 'charset=' . $params['charset'] . ';'; |
|
| 65 | + $dsn .= 'charset='.$params['charset'].';'; |
|
| 66 | 66 | } |
| 67 | 67 | |
| 68 | 68 | if (isset($params['socket']) && $params['socket'] != '') { |
| 69 | - $dsn .= 'unix_socket=' . $params['socket'] . ';'; |
|
| 69 | + $dsn .= 'unix_socket='.$params['socket'].';'; |
|
| 70 | 70 | } |
| 71 | 71 | |
| 72 | 72 | try { |
@@ -109,24 +109,24 @@ discard block |
||
| 109 | 109 | $result = array(); |
| 110 | 110 | $count = 0; |
| 111 | 111 | |
| 112 | - if(version_compare(PHP_VERSION, '5.4.0', '>=')) |
|
| 112 | + if (version_compare(PHP_VERSION, '5.4.0', '>=')) |
|
| 113 | 113 | { |
| 114 | 114 | try { |
| 115 | 115 | $statement = $this->connection->query(implode(';', $queue)); |
| 116 | 116 | } catch (\PDOException $exception) { |
| 117 | - throw new DatabaseException($exception->getMessage() .' [ '.implode(';', $queue).']'); |
|
| 117 | + throw new DatabaseException($exception->getMessage().' [ '.implode(';', $queue).']'); |
|
| 118 | 118 | } |
| 119 | 119 | |
| 120 | 120 | return MultiResultSet::make($statement); |
| 121 | 121 | } |
| 122 | 122 | else |
| 123 | 123 | { |
| 124 | - foreach($queue as $sql) |
|
| 124 | + foreach ($queue as $sql) |
|
| 125 | 125 | { |
| 126 | 126 | try { |
| 127 | 127 | $statement = $this->connection->query($sql); |
| 128 | 128 | } catch (\PDOException $exception) { |
| 129 | - throw new DatabaseException($exception->getMessage() .' [ '.implode(';', $queue).']'); |
|
| 129 | + throw new DatabaseException($exception->getMessage().' [ '.implode(';', $queue).']'); |
|
| 130 | 130 | } |
| 131 | 131 | if ($statement->columnCount()) { |
| 132 | 132 | $set = ResultSet::make($statement); |
@@ -38,8 +38,7 @@ discard block |
||
| 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 | |
@@ -118,8 +117,7 @@ discard block |
||
| 118 | 117 | } |
| 119 | 118 | |
| 120 | 119 | return MultiResultSet::make($statement); |
| 121 | - } |
|
| 122 | - else |
|
| 120 | + } else |
|
| 123 | 121 | { |
| 124 | 122 | foreach($queue as $sql) |
| 125 | 123 | { |
@@ -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)).')'; |