| @@ -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 | } | 
| @@ -149,7 +149,7 @@ discard block | ||
| 149 | 149 | 'password' => $this->_password[$connectionName], | 
| 150 | 150 | 'charset' => $this->_charset[$connectionName], | 
| 151 | 151 | 'schema' => $this->_schema[$connectionName]]; | 
| 152 | -        } else { | |
| 152 | +        }else { | |
| 153 | 153 |              throw new \Exception("The connection name $connectionName is not set."); | 
| 154 | 154 | } | 
| 155 | 155 | |
| @@ -183,7 +183,7 @@ discard block | ||
| 183 | 183 | |
| 184 | 184 | $connectionSettings = (object)$connectionSettings; | 
| 185 | 185 | |
| 186 | - $this->_connectionString[$connectionName] = $this->_driver[$connectionName].":host=$connectionSettings->host;dbname=$connectionSettings->database;port=$connectionSettings->port;"; | |
| 186 | + $this->_connectionString[$connectionName] = $this->_driver[$connectionName] . ":host=$connectionSettings->host;dbname=$connectionSettings->database;port=$connectionSettings->port;"; | |
| 187 | 187 | |
| 188 | 188 | return $this; | 
| 189 | 189 | } | 
| @@ -74,7 +74,7 @@ discard block | ||
| 74 | 74 | |
| 75 | 75 | $this->Result = new Result(); | 
| 76 | 76 | |
| 77 | -            if($this->Result && !$this->Result->getResults()) { | |
| 77 | +            if ($this->Result && !$this->Result->getResults()) { | |
| 78 | 78 | $clone = clone $this; | 
| 79 | 79 | $this->Result->setResults($clone); | 
| 80 | 80 | } | 
| @@ -188,7 +188,7 @@ discard block | ||
| 188 | 188 |              $this->_newData[] = $this->{$key}; | 
| 189 | 189 | |
| 190 | 190 | $update = true; | 
| 191 | -        } else { | |
| 191 | +        }else { | |
| 192 | 192 | $logger = [ | 
| 193 | 193 | 'function' => 'Save', | 
| 194 | 194 | 'next' => $this->_data, | 
| @@ -212,7 +212,7 @@ discard block | ||
| 212 | 212 | $insert = $this->Connection->getConnection()->prepare($sql); | 
| 213 | 213 | $this->burnError($insert); | 
| 214 | 214 | |
| 215 | -        $this->_newData = array_map(function ($data) { | |
| 215 | +        $this->_newData = array_map(function($data) { | |
| 216 | 216 | if (is_bool($data) and $data === false) $data = 0; | 
| 217 | 217 | |
| 218 | 218 | return $data; | 
| @@ -287,7 +287,7 @@ discard block | ||
| 287 | 287 | |
| 288 | 288 | $instance = self::$_instance; | 
| 289 | 289 | |
| 290 | - if (is_callable($this->triggerBefore)) ($this->triggerBefore)();; | |
| 290 | + if (is_callable($this->triggerBefore)) ($this->triggerBefore)(); ; | |
| 291 | 291 | |
| 292 | 292 | $start = microtime(true); | 
| 293 | 293 | |
| @@ -310,7 +310,7 @@ discard block | ||
| 310 | 310 | |
| 311 | 311 | return true; | 
| 312 | 312 | } | 
| 313 | -        else{ return false; }; | |
| 313 | +        else { return false; }; | |
| 314 | 314 | } | 
| 315 | 315 | |
| 316 | 316 | /** | 
| @@ -455,7 +455,7 @@ discard block | ||
| 455 | 455 | |
| 456 | 456 | $done = $instance->done(); | 
| 457 | 457 | |
| 458 | -        if(count($done) > 0) { | |
| 458 | +        if (count($done) > 0) { | |
| 459 | 459 | $done = $done[0]; | 
| 460 | 460 | |
| 461 | 461 | $clone = clone $done; | 
| @@ -557,7 +557,7 @@ discard block | ||
| 557 | 557 | |
| 558 | 558 |          if ($match) { | 
| 559 | 559 | $this->_data = $objetos = $consulta->fetchAll(\PDO::FETCH_CLASS, get_called_class()); | 
| 560 | -        } else { | |
| 560 | +        }else { | |
| 561 | 561 | $objetos = $consulta->rowCount(); | 
| 562 | 562 | } | 
| 563 | 563 | |
| @@ -27,7 +27,7 @@ discard block | ||
| 27 | 27 |      { | 
| 28 | 28 |          if (!($data instanceof self)) throw new \Exception(" It's not a model."); | 
| 29 | 29 | |
| 30 | -        $data = array_map(function ($object) { return $object->toArray(); }, $data); | |
| 30 | +        $data = array_map(function($object) { return $object->toArray(); }, $data); | |
| 31 | 31 | |
| 32 | 32 | return $data; | 
| 33 | 33 | } | 
| @@ -65,7 +65,7 @@ discard block | ||
| 65 | 65 | |
| 66 | 66 |          if (is_null($offset)) { | 
| 67 | 67 | $data[] = $value; | 
| 68 | -        } else { | |
| 68 | +        }else { | |
| 69 | 69 | $data[$offset] = $value; | 
| 70 | 70 | } | 
| 71 | 71 | } | 
| @@ -101,8 +101,7 @@ discard block | ||
| 101 | 101 | $default = $this->Config->getDefault(); | 
| 102 | 102 | |
| 103 | 103 | $name = is_null($default) ? | 
| 104 | - @end(array_keys($configs ?: [])) : | |
| 105 | - $default; | |
| 104 | + @end(array_keys($configs ?: [])) : $default; | |
| 106 | 105 | |
| 107 | 106 | $this->open($name); | 
| 108 | 107 | } | 
| @@ -133,7 +132,7 @@ discard block | ||
| 133 | 132 |                  } catch (\Exception $e) { | 
| 134 | 133 | throw $e; | 
| 135 | 134 | } | 
| 136 | -            } else { | |
| 135 | +            }else { | |
| 137 | 136 | |
| 138 | 137 |                  throw new \Exception("This connection isn't actived."); | 
| 139 | 138 | } | 
| @@ -42,7 +42,7 @@ | ||
| 42 | 42 | $this->results = $closure($connection); | 
| 43 | 43 |                  if ($this->results === false) { | 
| 44 | 44 | $connection->rollbackTransaction(); | 
| 45 | -                } else { | |
| 45 | +                }else { | |
| 46 | 46 | $connection->commitTransaction(); | 
| 47 | 47 | } | 
| 48 | 48 |              } catch (\Exception $e) { |