Passed
Push — master ( ac2aaf...2234fa )
by Fran
02:36
created
src/base/dto/Dto.php 1 patch
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -57,14 +57,14 @@  discard block
 block discarded – undo
57 57
                             }
58 58
                         }
59 59
                         $dto[$property->getName()] = $value;
60
-                    } else {
60
+                    }else {
61 61
                         $type = InjectorHelper::extractVarType($property->getDocComment());
62 62
                         $dto[$property->getName()] = $this->checkCastedValue($property->getValue($this), $type ?: 'string');
63 63
                     }
64 64
                 }
65 65
             }
66
-        } catch (\Exception $e) {
67
-            Logger::log(get_class($this) . ': ' . $e->getMessage(), LOG_ERR);
66
+        }catch (\Exception $e) {
67
+            Logger::log(get_class($this).': '.$e->getMessage(), LOG_ERR);
68 68
         }
69 69
         return $dto;
70 70
     }
@@ -101,12 +101,12 @@  discard block
 block discarded – undo
101 101
                             $this->$key[] = $dto;
102 102
                         }
103 103
                     }
104
-                } else {
104
+                }else {
105 105
                     $this->$key = clone $this->__cache[$type];
106 106
                     $this->$key->fromArray($value);
107 107
                 }
108 108
             }
109
-        } else {
109
+        }else {
110 110
             $this->castValue($key, $value, $type);
111 111
         }
112 112
     }
@@ -133,7 +133,7 @@  discard block
 block discarded – undo
133 133
     /**
134 134
      * @return mixed
135 135
      */
136
-    public function jsonSerialize(): array|string|null
136
+    public function jsonSerialize(): array | string | null
137 137
     {
138 138
         return $this->toArray();
139 139
     }
@@ -173,10 +173,10 @@  discard block
 block discarded – undo
173 173
      */
174 174
     protected function cleanArrayData(array $data): array {
175 175
         $cleanedData = [];
176
-        foreach($data as $key => $value) {
177
-            if(is_array($value)) {
176
+        foreach ($data as $key => $value) {
177
+            if (is_array($value)) {
178 178
                 $cleanedData[$key] = $this->cleanArrayData($value);
179
-            } else {
179
+            }else {
180 180
                 $cleanedData[$key] = htmlentities($value, ENT_QUOTES, 'UTF-8');
181 181
             }
182 182
         }
@@ -196,7 +196,7 @@  discard block
 block discarded – undo
196 196
                 case 'string':
197 197
                     if (is_array($rawValue)) {
198 198
                         $value = $this->cleanArrayData($rawValue);
199
-                    } else {
199
+                    }else {
200 200
                         $value = htmlentities($rawValue, ENT_QUOTES, 'UTF-8');
201 201
                     }
202 202
                     break;
@@ -213,7 +213,7 @@  discard block
 block discarded – undo
213 213
                     $value = (bool)$rawValue;
214 214
                     break;
215 215
             }
216
-        } else {
216
+        }else {
217 217
             $value = $rawValue;
218 218
         }
219 219
         return $value;
Please login to merge, or discard this patch.