Completed
Push — master ( 59e749...66990c )
by Dominik
02:03
created
src/Collection/LazyModelCollection.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -1,6 +1,6 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 
3
-declare(strict_types=1);
3
+declare(strict_types = 1);
4 4
 
5 5
 namespace Chubbyphp\Model\Collection;
6 6
 
@@ -89,11 +89,11 @@  discard block
 block discarded – undo
89 89
 
90 90
         $this->resolved = true;
91 91
 
92
-        $criteria = [$this->foreignField => $this->foreignId];
92
+        $criteria = [ $this->foreignField => $this->foreignId ];
93 93
 
94
-        $models = [];
94
+        $models = [ ];
95 95
         foreach ($this->resolver->findBy($this->modelClass, $criteria, $this->orderBy) as $model) {
96
-            $models[$model->getId()] = $model;
96
+            $models[ $model->getId() ] = $model;
97 97
         }
98 98
 
99 99
         $this->initialModels = $models;
@@ -111,7 +111,7 @@  discard block
 block discarded – undo
111 111
 
112 112
         $this->propertyReflection->setValue($model, $this->foreignId);
113 113
 
114
-        $this->models[$model->getId()] = $model;
114
+        $this->models[ $model->getId() ] = $model;
115 115
 
116 116
         return $this;
117 117
     }
@@ -125,10 +125,10 @@  discard block
 block discarded – undo
125 125
     {
126 126
         $this->resolveModels();
127 127
 
128
-        if (isset($this->models[$model->getId()])) {
128
+        if (isset($this->models[ $model->getId() ])) {
129 129
             $this->propertyReflection->setValue($model, null);
130 130
 
131
-            unset($this->models[$model->getId()]);
131
+            unset($this->models[ $model->getId() ]);
132 132
         }
133 133
 
134 134
         return $this;
@@ -200,9 +200,9 @@  discard block
 block discarded – undo
200 200
     {
201 201
         $this->resolveModels();
202 202
 
203
-        $serializedModels = [];
203
+        $serializedModels = [ ];
204 204
         foreach ($this->getModels() as $model) {
205
-            $serializedModels[] = $model->jsonSerialize();
205
+            $serializedModels[ ] = $model->jsonSerialize();
206 206
         }
207 207
 
208 208
         return $serializedModels;
Please login to merge, or discard this patch.
src/Collection/ModelCollection.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -1,6 +1,6 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 
3
-declare(strict_types=1);
3
+declare(strict_types = 1);
4 4
 
5 5
 namespace Chubbyphp\Model\Collection;
6 6
 
@@ -58,7 +58,7 @@  discard block
 block discarded – undo
58 58
         $this->foreignId = $foreignId;
59 59
         $this->orderBy = $orderBy;
60 60
 
61
-        $this->models = [];
61
+        $this->models = [ ];
62 62
 
63 63
         $this->propertyReflection = new \ReflectionProperty($this->modelClass, $this->foreignField);
64 64
         $this->propertyReflection->setAccessible(true);
@@ -73,7 +73,7 @@  discard block
 block discarded – undo
73 73
     {
74 74
         $this->propertyReflection->setValue($model, $this->foreignId);
75 75
 
76
-        $this->models[$model->getId()] = $model;
76
+        $this->models[ $model->getId() ] = $model;
77 77
 
78 78
         return $this;
79 79
     }
@@ -85,10 +85,10 @@  discard block
 block discarded – undo
85 85
      */
86 86
     public function removeModel(ModelInterface $model): ModelCollectionInterface
87 87
     {
88
-        if (isset($this->models[$model->getId()])) {
88
+        if (isset($this->models[ $model->getId() ])) {
89 89
             $this->propertyReflection->setValue($model, null);
90 90
 
91
-            unset($this->models[$model->getId()]);
91
+            unset($this->models[ $model->getId() ]);
92 92
         }
93 93
 
94 94
         return $this;
@@ -124,7 +124,7 @@  discard block
 block discarded – undo
124 124
      */
125 125
     public function getInitialModels(): array
126 126
     {
127
-        return [];
127
+        return [ ];
128 128
     }
129 129
 
130 130
     /**
@@ -148,9 +148,9 @@  discard block
 block discarded – undo
148 148
      */
149 149
     public function jsonSerialize(): array
150 150
     {
151
-        $serializedModels = [];
151
+        $serializedModels = [ ];
152 152
         foreach ($this->getModels() as $model) {
153
-            $serializedModels[] = $model->jsonSerialize();
153
+            $serializedModels[ ] = $model->jsonSerialize();
154 154
         }
155 155
 
156 156
         return $serializedModels;
Please login to merge, or discard this patch.