@@ -215,7 +215,7 @@ discard block |
||
| 215 | 215 | * Faz o update no banco do objeto especificado, se caso a opção execute_queries |
| 216 | 216 | * estiver habilitada |
| 217 | 217 | * |
| 218 | - * @return mixed |
|
| 218 | + * @return boolean |
|
| 219 | 219 | * @internal param array $conditions |
| 220 | 220 | * @internal param array $conjunctions |
| 221 | 221 | */ |
@@ -268,7 +268,7 @@ discard block |
||
| 268 | 268 | * Faz o delete no banco do objeto especificado, se caso a opção execute_queries |
| 269 | 269 | * estiver habilitada |
| 270 | 270 | * |
| 271 | - * @return mixed |
|
| 271 | + * @return boolean |
|
| 272 | 272 | * @internal param $ <T> $obj |
| 273 | 273 | * @internal param null $infos |
| 274 | 274 | */ |
@@ -228,14 +228,11 @@ discard block |
||
| 228 | 228 | "fields" => $this->fields, |
| 229 | 229 | "values" => $this->fieldsValues, |
| 230 | 230 | "where" => isset($this->infosMergeds['where']) ? |
| 231 | - $this->infosMergeds['where'] : |
|
| 232 | - null, |
|
| 231 | + $this->infosMergeds['where'] : null, |
|
| 233 | 232 | "limit" => isset($this->infosMergeds['limit']) ? |
| 234 | - $this->infosMergeds['limit'] : |
|
| 235 | - null, |
|
| 233 | + $this->infosMergeds['limit'] : null, |
|
| 236 | 234 | "offset" => isset($this->infosMergeds['offset']) ? |
| 237 | - $this->infosMergeds['offset'] : |
|
| 238 | - null |
|
| 235 | + $this->infosMergeds['offset'] : null |
|
| 239 | 236 | ]); |
| 240 | 237 | |
| 241 | 238 | if ($this->phiberConfig->verifyExecuteQueries()) { |
@@ -277,14 +274,11 @@ discard block |
||
| 277 | 274 | $this->sql = new PhiberQueryWriter("delete", [ |
| 278 | 275 | "table" => $this->table, |
| 279 | 276 | "where" => isset($this->infosMergeds['where']) ? |
| 280 | - $this->infosMergeds['where'] : |
|
| 281 | - null, |
|
| 277 | + $this->infosMergeds['where'] : null, |
|
| 282 | 278 | "limit" => isset($this->infosMergeds['limit']) ? |
| 283 | - $this->infosMergeds['limit'] : |
|
| 284 | - null, |
|
| 279 | + $this->infosMergeds['limit'] : null, |
|
| 285 | 280 | "offset" => isset($this->infosMergeds['offset']) ? |
| 286 | - $this->infosMergeds['offset'] : |
|
| 287 | - null |
|
| 281 | + $this->infosMergeds['offset'] : null |
|
| 288 | 282 | ]); |
| 289 | 283 | |
| 290 | 284 | if ($this->phiberConfig->verifyExecuteQueries()) { |
@@ -322,28 +316,22 @@ discard block |
||
| 322 | 316 | $fields = !empty($this->fields) ? $this->fields : ["*"]; |
| 323 | 317 | if (empty($this->fields)) { |
| 324 | 318 | $fields = isset($this->infosMergeds['fields']) ? |
| 325 | - implode(", ", $this->infosMergeds['fields']) : |
|
| 326 | - "*"; |
|
| 319 | + implode(", ", $this->infosMergeds['fields']) : "*"; |
|
| 327 | 320 | } |
| 328 | 321 | |
| 329 | 322 | $this->sql = new PhiberQueryWriter("select", [ |
| 330 | 323 | "table" => $this->table, |
| 331 | 324 | "fields" => $fields, |
| 332 | 325 | "where" => isset($this->infosMergeds['where']) ? |
| 333 | - $this->infosMergeds['where'] : |
|
| 334 | - null, |
|
| 326 | + $this->infosMergeds['where'] : null, |
|
| 335 | 327 | "limit" => isset($this->infosMergeds['limit']) ? |
| 336 | - $this->infosMergeds['limit'] : |
|
| 337 | - null, |
|
| 328 | + $this->infosMergeds['limit'] : null, |
|
| 338 | 329 | "offset" => isset($this->infosMergeds['offset']) ? |
| 339 | - $this->infosMergeds['offset'] : |
|
| 340 | - null, |
|
| 330 | + $this->infosMergeds['offset'] : null, |
|
| 341 | 331 | "orderby" => isset($this->infosMergeds['orderby']) ? |
| 342 | - $this->infosMergeds['orderby'] : |
|
| 343 | - null, |
|
| 332 | + $this->infosMergeds['orderby'] : null, |
|
| 344 | 333 | "join" => isset($this->joins) ? |
| 345 | - $this->joins : |
|
| 346 | - null |
|
| 334 | + $this->joins : null |
|
| 347 | 335 | ]); |
| 348 | 336 | |
| 349 | 337 | $result = []; |
@@ -24,7 +24,7 @@ discard block |
||
| 24 | 24 | |
| 25 | 25 | /** |
| 26 | 26 | * PhiberQueryWriter constructor. |
| 27 | - * @param $method |
|
| 27 | + * @param string $method |
|
| 28 | 28 | * @param $infos |
| 29 | 29 | */ |
| 30 | 30 | public function __construct($method, $infos) |
@@ -34,7 +34,7 @@ discard block |
||
| 34 | 34 | } |
| 35 | 35 | |
| 36 | 36 | /** |
| 37 | - * @return mixed |
|
| 37 | + * @return string |
|
| 38 | 38 | */ |
| 39 | 39 | function __toString() |
| 40 | 40 | { |
@@ -84,7 +84,7 @@ discard block |
||
| 84 | 84 | * Faz a query de update de um registro no banco com os dados. |
| 85 | 85 | * |
| 86 | 86 | * @param $infos |
| 87 | - * @return mixed |
|
| 87 | + * @return string |
|
| 88 | 88 | * @throws PhiberException |
| 89 | 89 | * @internal param $object |
| 90 | 90 | * @internal param $id |
@@ -129,7 +129,6 @@ |
||
| 129 | 129 | * OBS: O ":condition_idade" é o responsável por depois fazer o binding do valor para |
| 130 | 130 | * evitar SQL Injection. |
| 131 | 131 | * @param string $column |
| 132 | - * @param string $param2 |
|
| 133 | 132 | * @return array |
| 134 | 133 | */ |
| 135 | 134 | public function lessThen($column, $value) |
@@ -241,7 +241,7 @@ discard block |
||
| 241 | 241 | public function limit($limit) |
| 242 | 242 | { |
| 243 | 243 | return [ |
| 244 | - "limit" => (int)$limit . " " |
|
| 244 | + "limit" => (int) $limit . " " |
|
| 245 | 245 | ]; |
| 246 | 246 | } |
| 247 | 247 | |
@@ -256,7 +256,7 @@ discard block |
||
| 256 | 256 | */ |
| 257 | 257 | public function offset($offset) |
| 258 | 258 | { |
| 259 | - return [ "offset" => $offset ]; |
|
| 259 | + return ["offset" => $offset]; |
|
| 260 | 260 | } |
| 261 | 261 | |
| 262 | 262 | /** |
@@ -34,7 +34,7 @@ |
||
| 34 | 34 | * |
| 35 | 35 | * @param $object |
| 36 | 36 | * @param $nomeAtributo |
| 37 | - * @return bool|string |
|
| 37 | + * @return string|false |
|
| 38 | 38 | * @throws Exception |
| 39 | 39 | */ |
| 40 | 40 | public function pegaNomeAtributoEspecifico($object, $nomeAtributo) |
@@ -159,7 +159,7 @@ |
||
| 159 | 159 | |
| 160 | 160 | $parents = []; |
| 161 | 161 | $parent = ""; |
| 162 | - if ( self::verificaSeEClasseFilha($object) ) { |
|
| 162 | + if (self::verificaSeEClasseFilha($object)) { |
|
| 163 | 163 | while ($class->getParentClass()) { |
| 164 | 164 | $parents[] = $class->getParentClass()->getName(); |
| 165 | 165 | $class = $parent; |
@@ -100,7 +100,7 @@ |
||
| 100 | 100 | * @param string $string |
| 101 | 101 | * @param string $stringBusca |
| 102 | 102 | * @param string $substituicao |
| 103 | - * @return mixed |
|
| 103 | + * @return string |
|
| 104 | 104 | */ |
| 105 | 105 | public function substituiOcorrenciasDeUmaString($string, $stringBusca, $substituicao) |
| 106 | 106 | { |
@@ -38,11 +38,11 @@ |
||
| 38 | 38 | |
| 39 | 39 | $json = new JsonReader(BASE_DIR . self::PATH_CONFIG_FILE); |
| 40 | 40 | |
| 41 | - if (!empty(glob(dirname(__DIR__, 4) . self::PATH_CONFIG_FILE )[0])) { |
|
| 41 | + if (!empty(glob(dirname(__DIR__, 4) . self::PATH_CONFIG_FILE)[0])) { |
|
| 42 | 42 | $json = new JsonReader(glob(dirname(__DIR__, 4) . PATH_CONFIG_FILE)[0]); |
| 43 | 43 | } |
| 44 | 44 | |
| 45 | - $json= $json->read(); |
|
| 45 | + $json = $json->read(); |
|
| 46 | 46 | try { |
| 47 | 47 | |
| 48 | 48 | $connectionCache = $json->phiber->link->connection_cache == 1 ? true : false; |
@@ -193,7 +193,7 @@ |
||
| 193 | 193 | |
| 194 | 194 | /** |
| 195 | 195 | * @todo NOT NULL AQUI |
| 196 | - */ |
|
| 196 | + */ |
|
| 197 | 197 | |
| 198 | 198 | if (array_key_exists('notNull', $arrFormatado)) { |
| 199 | 199 | if ($arrFormatado['notNull'] === "true") { |
@@ -92,7 +92,7 @@ discard block |
||
| 92 | 92 | } |
| 93 | 93 | } |
| 94 | 94 | |
| 95 | - $contentFile = JsonReader::read(BASE_DIR."/phiber_config.json")->phiber->code_sync == 1 ? true : false; |
|
| 95 | + $contentFile = JsonReader::read(BASE_DIR . "/phiber_config.json")->phiber->code_sync == 1 ? true : false; |
|
| 96 | 96 | if ($contentFile) { |
| 97 | 97 | $pdo = self::getConnection()->prepare($sqlDrop); |
| 98 | 98 | if ($pdo->execute()) { |
@@ -225,7 +225,7 @@ discard block |
||
| 225 | 225 | $stringSql .= ""; |
| 226 | 226 | } |
| 227 | 227 | |
| 228 | - $fileContent = JsonReader::read(BASE_DIR."/phiber_config.json")->phiber->code_sync == 1 ? true : false; |
|
| 228 | + $fileContent = JsonReader::read(BASE_DIR . "/phiber_config.json")->phiber->code_sync == 1 ? true : false; |
|
| 229 | 229 | if ($fileContent) { |
| 230 | 230 | $pdo = self::getConnection()->prepare($stringSql); |
| 231 | 231 | $pdo->execute(); |
@@ -280,7 +280,7 @@ discard block |
||
| 280 | 280 | } |
| 281 | 281 | } |
| 282 | 282 | |
| 283 | - $jsonFile = JsonReader::read(BASE_DIR."/phiber_config.json")->phiber->code_sync == 1 ? true : false; |
|
| 283 | + $jsonFile = JsonReader::read(BASE_DIR . "/phiber_config.json")->phiber->code_sync == 1 ? true : false; |
|
| 284 | 284 | if ($jsonFile) { |
| 285 | 285 | $pdo = self::getConnection()->prepare($stringAlterTable); |
| 286 | 286 | if ($pdo->execute()) { |
@@ -238,10 +238,11 @@ |
||
| 238 | 238 | $stringAlterTable .= "CHANGE `" . $columnsTabela[$i]['Field'] . "` `$atributosTabela[$i]` "; |
| 239 | 239 | $stringAlterTable .= strtoupper($arrFinal[$i]['type']) . "(" . $arrFinal[$i]['size'] . ")\n"; |
| 240 | 240 | |
| 241 | - if ($arrFinal[$i]) |
|
| 242 | - |
|
| 241 | + if ($arrFinal[$i]) { |
|
| 242 | + |
|
| 243 | 243 | if ($i != count($arrFinal) - 1) { |
| 244 | 244 | $stringAlterTable .= ", \n"; |
| 245 | + } |
|
| 245 | 246 | } |
| 246 | 247 | } else { |
| 247 | 248 | $stringAlterTable .= "CHANGE `$atributosTabela[$i]` `$atributosTabela[$i]` "; |
@@ -23,7 +23,7 @@ discard block |
||
| 23 | 23 | */ |
| 24 | 24 | public static function create($languageReference, $level = 'info', $objectName = '', $execTime = null) |
| 25 | 25 | { |
| 26 | - if (JsonReader::read(BASE_DIR.'/phiber_config.json')->phiber->log == 1 ? true : false) { |
|
| 26 | + if (JsonReader::read(BASE_DIR . '/phiber_config.json')->phiber->log == 1 ? true : false) { |
|
| 27 | 27 | $date = date('Y-m-d H:i:s'); |
| 28 | 28 | switch ($level) { |
| 29 | 29 | case 'info': |
@@ -32,8 +32,8 @@ discard block |
||
| 32 | 32 | new Internationalization("reference") . |
| 33 | 33 | "=> \"$objectName\") " . new Internationalization($languageReference) . |
| 34 | 34 | " - "; |
| 35 | - if($execTime != null){ |
|
| 36 | - $msg .= "em " . $execTime . "."; |
|
| 35 | + if ($execTime != null) { |
|
| 36 | + $msg .= "em " . $execTime . "."; |
|
| 37 | 37 | } |
| 38 | 38 | echo $msg . "\e[0m \n"; |
| 39 | 39 | break; |
@@ -44,8 +44,8 @@ discard block |
||
| 44 | 44 | new Internationalization("reference") . |
| 45 | 45 | "=> \"$objectName\") " . new Internationalization($languageReference) . |
| 46 | 46 | " - "; |
| 47 | - if($execTime != null){ |
|
| 48 | - $msg .= "em " . $execTime . "."; |
|
| 47 | + if ($execTime != null) { |
|
| 48 | + $msg .= "em " . $execTime . "."; |
|
| 49 | 49 | } |
| 50 | 50 | echo $msg . "\e[0m \n"; |
| 51 | 51 | break; |
@@ -56,8 +56,8 @@ discard block |
||
| 56 | 56 | new Internationalization("reference") . |
| 57 | 57 | "=> \"$objectName\") " . new Internationalization($languageReference) . |
| 58 | 58 | " - "; |
| 59 | - if($execTime != null){ |
|
| 60 | - $msg .= "em " . $execTime . "."; |
|
| 59 | + if ($execTime != null) { |
|
| 60 | + $msg .= "em " . $execTime . "."; |
|
| 61 | 61 | } |
| 62 | 62 | echo $msg . "\e[0m \n"; |
| 63 | 63 | break; |
@@ -36,7 +36,7 @@ |
||
| 36 | 36 | */ |
| 37 | 37 | public function read() |
| 38 | 38 | { |
| 39 | - $content = file_get_contents($this->file); |
|
| 39 | + $content = file_get_contents($this->file); |
|
| 40 | 40 | |
| 41 | 41 | $read = json_decode($content); |
| 42 | 42 | |