Passed
Push — main ( abdbfe...29aefa )
by Pranjal
02:38
created
src/Manager/WriteManager.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -51,7 +51,7 @@  discard block
 block discarded – undo
51 51
 
52 52
         $this->ensureTableExists($model);
53 53
 
54
-        $id = $this->executeInTransaction(function () use ($model) {
54
+        $id = $this->executeInTransaction(function() use ($model) {
55 55
             $id = $this->createRecords($model);
56 56
             $model->set(self::ID_FIELD, $id);
57 57
 
@@ -189,7 +189,7 @@  discard block
 block discarded – undo
189 189
             $this->createTable($foreign);
190 190
         }
191 191
 
192
-        $this->executeInTransaction(function () use ($model) {
192
+        $this->executeInTransaction(function() use ($model) {
193 193
             foreach ($model->getForeignModels(self::RELATION_ONE_TO_ONE) as $foreign) {
194 194
                 $id = $this->createRecords($foreign);
195 195
                 $this->finalizeModel($foreign);
@@ -211,7 +211,7 @@  discard block
 block discarded – undo
211 211
             $this->createTable($foreign, $this->createConstraintsOtm($model));
212 212
         }
213 213
 
214
-        $this->executeInTransaction(function () use ($model) {
214
+        $this->executeInTransaction(function() use ($model) {
215 215
             foreach ($model->getForeignModels(self::RELATION_ONE_TO_MANY) as $foreign) {
216 216
                 $this->createRecords($foreign);
217 217
                 $this->finalizeModel($foreign);
@@ -243,7 +243,7 @@  discard block
 block discarded – undo
243 243
             );
244 244
         }
245 245
 
246
-        $this->executeInTransaction(function () use ($model, $id) {
246
+        $this->executeInTransaction(function() use ($model, $id) {
247 247
             foreach ($model->getForeignModels(self::RELATION_MANY_TO_MANY) as $foreign) {
248 248
                 $rel_id = $this->createRecords($foreign);
249 249
                 $this->finalizeModel($foreign);
Please login to merge, or discard this patch.
src/Model.php 2 patches
Indentation   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -182,9 +182,9 @@  discard block
 block discarded – undo
182 182
 
183 183
         $db = $this->recordManager->find(strtolower((string) $parts[1]));
184 184
         $db->where($this->getName().'_id = :id')
185
-           ->setParameter('id', $this->__meta['id'],
186
-               $this->determineIdType($this->__meta['id'])
187
-           );
185
+            ->setParameter('id', $this->__meta['id'],
186
+                $this->determineIdType($this->__meta['id'])
187
+            );
188 188
 
189 189
         $result = $db->get();
190 190
         $this->set($key, $result);
@@ -203,9 +203,9 @@  discard block
 block discarded – undo
203 203
 
204 204
         $db = $this->recordManager->find($relTable);
205 205
         $db->where($this->getName().'_id = :id')
206
-           ->setParameter('id', $this->__meta['id'],
207
-               $this->determineIdType($this->__meta['id'])
208
-           );
206
+            ->setParameter('id', $this->__meta['id'],
207
+                $this->determineIdType($this->__meta['id'])
208
+            );
209 209
 
210 210
         $relations = $db->get();
211 211
         $relIds = $this->extractRelationIds($relations, $targetTable);
@@ -216,9 +216,9 @@  discard block
 block discarded – undo
216 216
 
217 217
         $db = $this->recordManager->find($targetTable);
218 218
         $db->where('id IN (:ids)')
219
-           ->setParameter('ids', $relIds,
220
-               $this->determineIdsType($relIds)
221
-           );
219
+            ->setParameter('ids', $relIds,
220
+                $this->determineIdsType($relIds)
221
+            );
222 222
 
223 223
         $result = $db->get();
224 224
 
Please login to merge, or discard this patch.
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -242,7 +242,7 @@  discard block
 block discarded – undo
242 242
 
243 243
     private function extractRelationIds(Collection $relations, string $targetTable): array
244 244
     {
245
-        return $relations->map(function ($relation) use ($targetTable) {
245
+        return $relations->map(function($relation) use ($targetTable) {
246 246
             $key = $targetTable.'_id';
247 247
 
248 248
             return $relation->$key;
@@ -426,7 +426,7 @@  discard block
 block discarded – undo
426 426
      *
427 427
      * @throws Exception\InvalidModelException
428 428
      */
429
-    private function createCollection(?Collection $collection, array|Collection $models): Collection
429
+    private function createCollection(?Collection $collection, array | Collection $models): Collection
430 430
     {
431 431
         if (is_null($collection)) {
432 432
             $collection = Collection::fromIterable([]);
@@ -507,7 +507,7 @@  discard block
 block discarded – undo
507 507
     /**
508 508
      * Determines the ParameterType for an ID value.
509 509
      */
510
-    private function determineIdType(int|string $id): ParameterType
510
+    private function determineIdType(int | string $id): ParameterType
511 511
     {
512 512
         return is_int($id) ? ParameterType::INTEGER : ParameterType::STRING;
513 513
     }
Please login to merge, or discard this patch.