@@ -134,7 +134,7 @@ |
||
134 | 134 | 'password' => $this->_password[$connectionName], |
135 | 135 | 'charset' => $this->_charset[$connectionName], |
136 | 136 | 'schema' => $this->_schema[$connectionName]]; |
137 | - } else { |
|
137 | + }else { |
|
138 | 138 | throw new \Exception("The connection name $connectionName is not set."); |
139 | 139 | } |
140 | 140 |
@@ -135,8 +135,8 @@ discard block |
||
135 | 135 | if (!empty($this->_data[$key])) { |
136 | 136 | $sql = 'UPDATE ' . $_tableName . ' SET '; |
137 | 137 | |
138 | - if (count($this->_newData) <= 0){ |
|
139 | - Error::create('Don\'t have alter data.', 1,'InvalidArgumentException'); |
|
138 | + if (count($this->_newData) <= 0) { |
|
139 | + Error::create('Don\'t have alter data.', 1, 'InvalidArgumentException'); |
|
140 | 140 | return false; |
141 | 141 | } |
142 | 142 | |
@@ -146,7 +146,7 @@ discard block |
||
146 | 146 | $this->_newData[] = $this->{$key}; |
147 | 147 | |
148 | 148 | $update = true; |
149 | - } else { |
|
149 | + }else { |
|
150 | 150 | /** |
151 | 151 | * Insert case don't have primary key |
152 | 152 | */ |
@@ -162,8 +162,8 @@ discard block |
||
162 | 162 | $insert = $this->Connection->getConnection()->prepare($sql); |
163 | 163 | $this->burnError($insert); |
164 | 164 | |
165 | - $this->_newData = array_map(function ($data){ |
|
166 | - if(is_bool($data) and $data === false) $data = 0; |
|
165 | + $this->_newData = array_map(function($data) { |
|
166 | + if (is_bool($data) and $data === false) $data = 0; |
|
167 | 167 | |
168 | 168 | return $data; |
169 | 169 | }, $this->_newData); |
@@ -192,7 +192,7 @@ discard block |
||
192 | 192 | return true; |
193 | 193 | } |
194 | 194 | |
195 | - private function burnError($statment){ |
|
195 | + private function burnError($statment) { |
|
196 | 196 | if (!is_null($statment->errorInfo()[1])) throw new \Exception($statment->errorInfo()[2], $statment->errorInfo()[1]); |
197 | 197 | } |
198 | 198 | |
@@ -217,7 +217,7 @@ discard block |
||
217 | 217 | |
218 | 218 | $instance = self::$_instance; |
219 | 219 | |
220 | - if (is_callable($this->triggerBefore)) ($this->triggerBefore)();; |
|
220 | + if (is_callable($this->triggerBefore)) ($this->triggerBefore)(); ; |
|
221 | 221 | |
222 | 222 | $start = microtime(true); |
223 | 223 | |
@@ -373,7 +373,7 @@ discard block |
||
373 | 373 | |
374 | 374 | if ($instance->Connection->getConnection()->lastInsertId() == '-1' || $instance->Connection->getConnection()->lastInsertId() == 0) { |
375 | 375 | return false; |
376 | - } else { |
|
376 | + }else { |
|
377 | 377 | return $instance; |
378 | 378 | } |
379 | 379 | } |
@@ -526,7 +526,7 @@ discard block |
||
526 | 526 | |
527 | 527 | if ($match) { |
528 | 528 | $this->_data = $objetos = $consulta->fetchAll(\PDO::FETCH_CLASS, get_called_class()); |
529 | - } else { |
|
529 | + }else { |
|
530 | 530 | $objetos = $consulta->rowCount(); |
531 | 531 | } |
532 | 532 |
@@ -202,7 +202,7 @@ |
||
202 | 202 | if (substr_count($last, 'ORDER BY') > 0) { |
203 | 203 | $sql .= isset($this->_group) ? $this->_group : ''; |
204 | 204 | $sql .= $last; |
205 | - } else { |
|
205 | + }else { |
|
206 | 206 | $sql .= $last; |
207 | 207 | $sql .= isset($this->_group) ? $this->_group : ''; |
208 | 208 | } |
@@ -100,8 +100,7 @@ discard block |
||
100 | 100 | $default = $this->Config->getDefault(); |
101 | 101 | |
102 | 102 | $name = is_null($default) ? |
103 | - @end(array_keys($configs)) : |
|
104 | - $this->Config->getDefault(); |
|
103 | + @end(array_keys($configs)) : $this->Config->getDefault(); |
|
105 | 104 | |
106 | 105 | self::open($name); |
107 | 106 | } |
@@ -132,7 +131,7 @@ discard block |
||
132 | 131 | } catch (\Exception $e) { |
133 | 132 | throw $e; |
134 | 133 | } |
135 | - } else { |
|
134 | + }else { |
|
136 | 135 | |
137 | 136 | throw new \Exception("This connection isn't actived."); |
138 | 137 | } |
@@ -178,7 +177,7 @@ discard block |
||
178 | 177 | { |
179 | 178 | if (array_key_exists($connectionName, $this->connections)) { |
180 | 179 | return true; |
181 | - } else { |
|
180 | + }else { |
|
182 | 181 | return false; |
183 | 182 | } |
184 | 183 | } |
@@ -201,7 +200,7 @@ discard block |
||
201 | 200 | { |
202 | 201 | if (array_key_exists($connectionName, $this->Config->getConfigs())) { |
203 | 202 | return true; |
204 | - } else { |
|
203 | + }else { |
|
205 | 204 | return false; |
206 | 205 | } |
207 | 206 | } |
@@ -38,7 +38,7 @@ discard block |
||
38 | 38 | if (!is_callable($closure)) { |
39 | 39 | throw new \Exception("Transaction must have a callable as parameter."); |
40 | 40 | |
41 | - } else { |
|
41 | + }else { |
|
42 | 42 | $connection = $this->getConnection(); |
43 | 43 | |
44 | 44 | try { |
@@ -48,7 +48,7 @@ discard block |
||
48 | 48 | |
49 | 49 | if ($this->results === false) { |
50 | 50 | $connection->rollbackTransaction(); |
51 | - } else { |
|
51 | + }else { |
|
52 | 52 | $connection->commitTransaction(); |
53 | 53 | } |
54 | 54 |