Passed
Push — master ( 4a5001...928012 )
by Robson
01:21
created
example/Models/Address.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -15,6 +15,6 @@
 block discarded – undo
15 15
      */
16 16
     public function __construct()
17 17
     {
18
-        parent::__construct("address", [], 'address_id');
18
+        parent::__construct("address", [ ], 'address_id');
19 19
     }
20 20
 }
21 21
\ No newline at end of file
Please login to merge, or discard this patch.
example/Models/User.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -15,6 +15,6 @@
 block discarded – undo
15 15
      */
16 16
     public function __construct()
17 17
     {
18
-        parent::__construct("users", ["first_name", "last_name"]);
18
+        parent::__construct("users", [ "first_name", "last_name" ]);
19 19
     }
20 20
 }
21 21
\ No newline at end of file
Please login to merge, or discard this patch.
src/Connect.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -25,10 +25,10 @@
 block discarded – undo
25 25
         if (empty(self::$instance)) {
26 26
             try {
27 27
                 self::$instance = new PDO(
28
-                    DATA_LAYER_CONFIG["driver"] . ":host=" . DATA_LAYER_CONFIG["host"] . ";dbname=" . DATA_LAYER_CONFIG["dbname"] . ";port=" . DATA_LAYER_CONFIG["port"],
29
-                    DATA_LAYER_CONFIG["username"],
30
-                    DATA_LAYER_CONFIG["passwd"],
31
-                    DATA_LAYER_CONFIG["options"]
28
+                    DATA_LAYER_CONFIG[ "driver" ] . ":host=" . DATA_LAYER_CONFIG[ "host" ] . ";dbname=" . DATA_LAYER_CONFIG[ "dbname" ] . ";port=" . DATA_LAYER_CONFIG[ "port" ],
29
+                    DATA_LAYER_CONFIG[ "username" ],
30
+                    DATA_LAYER_CONFIG[ "passwd" ],
31
+                    DATA_LAYER_CONFIG[ "options" ]
32 32
                 );
33 33
             } catch (PDOException $exception) {
34 34
                 self::$error = $exception;
Please login to merge, or discard this patch.
example/save_example.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -27,12 +27,12 @@
 block discarded – undo
27 27
  */
28 28
 print "update user";
29 29
 
30
-$name = ["Robson", "Kaue", "Gustavo", "João"];
30
+$name = [ "Robson", "Kaue", "Gustavo", "João" ];
31 31
 
32 32
 $user = (new User())->findById(10000);
33 33
 
34 34
 if ($user) {
35
-    $user->first_name = $name[rand(0, 3)];
35
+    $user->first_name = $name[ rand(0, 3) ];
36 36
     $user->save();
37 37
     var_dump($user);
38 38
 } else {
Please login to merge, or discard this patch.
src/DataLayer.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -261,9 +261,9 @@  discard block
 block discarded – undo
261 261
      */
262 262
     protected function required(): bool
263 263
     {
264
-        $data = (array)$this->data();
264
+        $data = (array) $this->data();
265 265
         foreach ($this->required as $field) {
266
-            if (empty($data[$field])) {
266
+            if (empty($data[ $field ])) {
267 267
                 return false;
268 268
             }
269 269
         }
@@ -275,8 +275,8 @@  discard block
 block discarded – undo
275 275
      */
276 276
     protected function safe(): ?array
277 277
     {
278
-        $safe = (array)$this->data;
279
-        unset($safe[$this->primary]);
278
+        $safe = (array) $this->data;
279
+        unset($safe[ $this->primary ]);
280 280
 
281 281
         return $safe;
282 282
     }
Please login to merge, or discard this patch.
src/CrudTrait.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -20,8 +20,8 @@  discard block
 block discarded – undo
20 20
     protected function create(array $data): ?int
21 21
     {
22 22
         if ($this->timestamps) {
23
-            $data["created_at"] = (new DateTime("now"))->format("Y-m-d H:i:s");
24
-            $data["updated_at"] = $data["created_at"];
23
+            $data[ "created_at" ] = (new DateTime("now"))->format("Y-m-d H:i:s");
24
+            $data[ "updated_at" ] = $data[ "created_at" ];
25 25
         }
26 26
         $data = filter_var_array($data, FILTER_SANITIZE_SPECIAL_CHARS);
27 27
 
@@ -49,14 +49,14 @@  discard block
 block discarded – undo
49 49
     protected function update(array $data, string $terms, string $params): ?int
50 50
     {
51 51
         if ($this->timestamps) {
52
-            $data["updated_at"] = (new DateTime("now"))->format("Y-m-d H:i:s");
52
+            $data[ "updated_at" ] = (new DateTime("now"))->format("Y-m-d H:i:s");
53 53
         }
54 54
         $data = filter_var_array($data, FILTER_SANITIZE_SPECIAL_CHARS);
55 55
 
56 56
         try {
57
-            $dateSet = [];
57
+            $dateSet = [ ];
58 58
             foreach ($data as $bind => $value) {
59
-                $dateSet[] = "{$bind} = :{$bind}";
59
+                $dateSet[ ] = "{$bind} = :{$bind}";
60 60
             }
61 61
             $dateSet = implode(", ", $dateSet);
62 62
             parse_str($params, $params);
@@ -99,9 +99,9 @@  discard block
 block discarded – undo
99 99
      */
100 100
     private function filter(array $data): ?array
101 101
     {
102
-        $filter = [];
102
+        $filter = [ ];
103 103
         foreach ($data as $key => $value) {
104
-            $filter[$key] = (is_null($value) ? null : filter_var($value, FILTER_DEFAULT));
104
+            $filter[ $key ] = (is_null($value) ? null : filter_var($value, FILTER_DEFAULT));
105 105
         }
106 106
         return $filter;
107 107
     }
Please login to merge, or discard this patch.