@@ -14,7 +14,7 @@ |
||
| 14 | 14 | { |
| 15 | 15 | public function __construct() |
| 16 | 16 | { |
| 17 | - spl_autoload_register(function ($class) { |
|
| 17 | + spl_autoload_register(function($class) { |
|
| 18 | 18 | include_once(str_replace('\\', '/', $class . '.php')); |
| 19 | 19 | }); |
| 20 | 20 | } |
@@ -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; |
@@ -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 | /** |
@@ -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 = []; |
@@ -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()) { |
@@ -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; |
@@ -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; |
@@ -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 | |
@@ -20,7 +20,7 @@ discard block |
||
| 20 | 20 | */ |
| 21 | 21 | final public static function converterDataParaBrasileira($data) |
| 22 | 22 | { |
| 23 | - return date( 'd-m-Y', strtotime($data) ); |
|
| 23 | + return date('d-m-Y', strtotime($data)); |
|
| 24 | 24 | } |
| 25 | 25 | |
| 26 | 26 | /** |
@@ -34,6 +34,6 @@ discard block |
||
| 34 | 34 | setlocale(LC_ALL, 'pt_BR', 'pt_BR.utf-8', 'pt_BR.utf-8', 'portuguese'); |
| 35 | 35 | date_default_timezone_set('America/Sao_Paulo'); |
| 36 | 36 | |
| 37 | - return strftime('%A, %d de %B de %Y', strtotime($data) ); |
|
| 37 | + return strftime('%A, %d de %B de %Y', strtotime($data)); |
|
| 38 | 38 | } |
| 39 | 39 | } |
| 40 | 40 | \ No newline at end of file |