Completed
Push — master ( e1c269...513975 )
by Dominik
02:01
created
src/ModelInterface.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,6 +1,6 @@
 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;
6 6
 
Please login to merge, or discard this patch.
src/Exception/NotUniqueException.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,6 +1,6 @@
 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;
6 6
 
Please login to merge, or discard this patch.
src/Cache/ModelCacheInterface.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,6 +1,6 @@
 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;
6 6
 
Please login to merge, or discard this patch.
src/Cache/RowNotFoundException.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,6 +1,6 @@
 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;
6 6
 
Please login to merge, or discard this patch.
src/Cache/ModelCache.php 1 patch
Spacing   +5 added lines, -5 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\Cache;
6 6
 
@@ -9,7 +9,7 @@  discard block
 block discarded – undo
9 9
     /**
10 10
      * @var array
11 11
      */
12
-    private $cache = [];
12
+    private $cache = [ ];
13 13
 
14 14
     /**
15 15
      * @param string $id
@@ -19,7 +19,7 @@  discard block
 block discarded – undo
19 19
      */
20 20
     public function set(string $id, array $row): ModelCacheInterface
21 21
     {
22
-        $this->cache[$id] = $row;
22
+        $this->cache[ $id ] = $row;
23 23
 
24 24
         return $this;
25 25
     }
@@ -47,7 +47,7 @@  discard block
 block discarded – undo
47 47
             throw RowNotFoundException::fromId($id);
48 48
         }
49 49
 
50
-        return $this->cache[$id];
50
+        return $this->cache[ $id ];
51 51
     }
52 52
 
53 53
     /**
@@ -57,7 +57,7 @@  discard block
 block discarded – undo
57 57
      */
58 58
     public function remove(string $id): ModelCacheInterface
59 59
     {
60
-        unset($this->cache[$id]);
60
+        unset($this->cache[ $id ]);
61 61
 
62 62
         return $this;
63 63
     }
Please login to merge, or discard this patch.
src/RepositoryInterface.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,6 +1,6 @@
 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;
6 6
 
Please login to merge, or discard this patch.
src/Resolver.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -12,7 +12,7 @@  discard block
 block discarded – undo
12 12
      */
13 13
     public function find(RepositoryInterface $repository, string $id): \Closure
14 14
     {
15
-        return function () use ($repository, $id) {
15
+        return function() use ($repository, $id) {
16 16
             return $repository->find($id);
17 17
         };
18 18
     }
@@ -25,7 +25,7 @@  discard block
 block discarded – undo
25 25
      */
26 26
     public function findOneBy(RepositoryInterface $repository, array $criteria): \Closure
27 27
     {
28
-        return function () use ($repository, $criteria) {
28
+        return function() use ($repository, $criteria) {
29 29
             return $repository->findOneBy($criteria);
30 30
         };
31 31
     }
Please login to merge, or discard this patch.
src/Collection/LazyModelCollection.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -50,7 +50,7 @@  discard block
 block discarded – undo
50 50
      */
51 51
     private function modelsWithIdKey(array $models): array
52 52
     {
53
-        $modelsWithIdKey = [];
53
+        $modelsWithIdKey = [ ];
54 54
         foreach ($models as $model) {
55 55
             if (!$model instanceof ModelInterface) {
56 56
                 throw new \InvalidArgumentException(
@@ -58,7 +58,7 @@  discard block
 block discarded – undo
58 58
                 );
59 59
             }
60 60
 
61
-            $modelsWithIdKey[$model->getId()] = $model;
61
+            $modelsWithIdKey[ $model->getId() ] = $model;
62 62
         }
63 63
 
64 64
         return $modelsWithIdKey;
@@ -138,10 +138,10 @@  discard block
 block discarded – undo
138 138
     {
139 139
         $this->loadModels();
140 140
 
141
-        $toRemoveModels = [];
141
+        $toRemoveModels = [ ];
142 142
         foreach ($this->initialModels as $initialModel) {
143
-            if (!isset($this->models[$initialModel->getId()])) {
144
-                $toRemoveModels[$initialModel->getId()] = $initialModel;
143
+            if (!isset($this->models[ $initialModel->getId() ])) {
144
+                $toRemoveModels[ $initialModel->getId() ] = $initialModel;
145 145
             }
146 146
         }
147 147
 
@@ -155,9 +155,9 @@  discard block
 block discarded – undo
155 155
     {
156 156
         $this->loadModels();
157 157
 
158
-        $serializedModels = [];
158
+        $serializedModels = [ ];
159 159
         foreach ($this->models as $model) {
160
-            $serializedModels[] = $model->jsonSerialize();
160
+            $serializedModels[ ] = $model->jsonSerialize();
161 161
         }
162 162
 
163 163
         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
@@ -19,7 +19,7 @@  discard block
 block discarded – undo
19 19
     /**
20 20
      * @param ModelInterface[]|array $models
21 21
      */
22
-    public function __construct(array $models = [])
22
+    public function __construct(array $models = [ ])
23 23
     {
24 24
         $models = $this->modelsWithIdKey($models);
25 25
 
@@ -34,7 +34,7 @@  discard block
 block discarded – undo
34 34
      */
35 35
     private function modelsWithIdKey(array $models): array
36 36
     {
37
-        $modelsWithIdKey = [];
37
+        $modelsWithIdKey = [ ];
38 38
         foreach ($models as $model) {
39 39
             if (!$model instanceof ModelInterface) {
40 40
                 throw new \InvalidArgumentException(
@@ -42,7 +42,7 @@  discard block
 block discarded – undo
42 42
                 );
43 43
             }
44 44
 
45
-            $modelsWithIdKey[$model->getId()] = $model;
45
+            $modelsWithIdKey[ $model->getId() ] = $model;
46 46
         }
47 47
 
48 48
         return $modelsWithIdKey;
@@ -106,10 +106,10 @@  discard block
 block discarded – undo
106 106
      */
107 107
     public function toRemove(): array
108 108
     {
109
-        $toRemoveModels = [];
109
+        $toRemoveModels = [ ];
110 110
         foreach ($this->initialModels as $initialModel) {
111
-            if (!isset($this->models[$initialModel->getId()])) {
112
-                $toRemoveModels[$initialModel->getId()] = $initialModel;
111
+            if (!isset($this->models[ $initialModel->getId() ])) {
112
+                $toRemoveModels[ $initialModel->getId() ] = $initialModel;
113 113
             }
114 114
         }
115 115
 
@@ -121,9 +121,9 @@  discard block
 block discarded – undo
121 121
      */
122 122
     public function jsonSerialize(): array
123 123
     {
124
-        $serializedModels = [];
124
+        $serializedModels = [ ];
125 125
         foreach ($this->models as $model) {
126
-            $serializedModels[] = $model->jsonSerialize();
126
+            $serializedModels[ ] = $model->jsonSerialize();
127 127
         }
128 128
 
129 129
         return $serializedModels;
Please login to merge, or discard this patch.