Passed
Push — master ( d8165d...eff7f5 )
by Robson
01:22
created
src/DataLayer.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -251,9 +251,9 @@  discard block
 block discarded – undo
251 251
      */
252 252
     protected function required(): bool
253 253
     {
254
-        $data = (array)$this->data();
254
+        $data = (array) $this->data();
255 255
         foreach ($this->required as $field) {
256
-            if (empty($data[$field])) {
256
+            if (empty($data[ $field ])) {
257 257
                 return false;
258 258
             }
259 259
         }
@@ -265,9 +265,9 @@  discard block
 block discarded – undo
265 265
      */
266 266
     protected function safe(): ?array
267 267
     {
268
-        $safe = (array)$this->data;
269
-        foreach ([$this->primary, "updated_at", "created_at"] as $unset) {
270
-            unset($safe[$unset]);
268
+        $safe = (array) $this->data;
269
+        foreach ([ $this->primary, "updated_at", "created_at" ] as $unset) {
270
+            unset($safe[ $unset ]);
271 271
         }
272 272
 
273 273
         return $safe;
Please login to merge, or discard this patch.
src/CrudTrait.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -37,9 +37,9 @@  discard block
 block discarded – undo
37 37
     protected function update(array $data, string $terms, string $params): ?int
38 38
     {
39 39
         try {
40
-            $dateSet = [];
40
+            $dateSet = [ ];
41 41
             foreach ($data as $bind => $value) {
42
-                $dateSet[] = "{$bind} = :{$bind}";
42
+                $dateSet[ ] = "{$bind} = :{$bind}";
43 43
             }
44 44
             $dateSet = implode(", ", $dateSet);
45 45
             parse_str($params, $params);
@@ -82,9 +82,9 @@  discard block
 block discarded – undo
82 82
      */
83 83
     private function filter(array $data): ?array
84 84
     {
85
-        $filter = [];
85
+        $filter = [ ];
86 86
         foreach ($data as $key => $value) {
87
-            $filter[$key] = (is_null($value) ? null : filter_var($value, FILTER_DEFAULT));
87
+            $filter[ $key ] = (is_null($value) ? null : filter_var($value, FILTER_DEFAULT));
88 88
         }
89 89
         return $filter;
90 90
     }
Please login to merge, or discard this patch.
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 2 patches
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -22,15 +22,15 @@
 block discarded – undo
22 22
 
23 23
 print "update user";
24 24
 
25
-$name = ["Robson", "Kaue", "Gustavo", "João"];
25
+$name = [ "Robson", "Kaue", "Gustavo", "João" ];
26 26
 
27 27
 $user = (new User())->findById(10000);
28 28
 
29 29
 if ($user) {
30
-    $user->first_name = $name[rand(0, 3)];
30
+    $user->first_name = $name[ rand(0, 3) ];
31 31
     $user->save();
32 32
     var_dump($user);
33
-}else{
33
+} else {
34 34
     echo "<h2>Not User</h2>";
35 35
 }
36 36
 
Please login to merge, or discard this patch.
Braces   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -30,7 +30,7 @@
 block discarded – undo
30 30
     $user->first_name = $name[rand(0, 3)];
31 31
     $user->save();
32 32
     var_dump($user);
33
-}else{
33
+} else{
34 34
     echo "<h2>Not User</h2>";
35 35
 }
36 36
 
Please login to merge, or discard this patch.
example/find_example.php 2 patches
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -24,11 +24,11 @@
 block discarded – undo
24 24
 $totalUsers = $model->find()->count();
25 25
 var_dump($totalUsers);
26 26
 
27
-if($users){
27
+if ($users) {
28 28
     foreach ($users as $user) {
29 29
         var_dump($user);
30 30
     }
31
-}else{
31
+} else {
32 32
     echo "<h2>Not Users</h2>";
33 33
 }
34 34
 
Please login to merge, or discard this patch.
Braces   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -28,7 +28,7 @@
 block discarded – undo
28 28
     foreach ($users as $user) {
29 29
         var_dump($user);
30 30
     }
31
-}else{
31
+} else{
32 32
     echo "<h2>Not Users</h2>";
33 33
 }
34 34
 
Please login to merge, or discard this patch.