Completed
Pull Request — master (#3)
by
unknown
10:05 queued 26s
created
src/Query.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -33,9 +33,9 @@  discard block
 block discarded – undo
33 33
      */
34 34
     public function __construct(
35 35
         Collection $collection,
36
-        int $type=self::TYPE_FIND,
37
-        array $querySettings=[],
38
-        array $options=[]
36
+        int $type = self::TYPE_FIND,
37
+        array $querySettings = [ ],
38
+        array $options = [ ]
39 39
     ) {
40 40
         $this->collection = $collection;
41 41
         $this->querySettings = $querySettings;
@@ -50,7 +50,7 @@  discard block
 block discarded – undo
50 50
      */
51 51
     public function execute()
52 52
     {
53
-        switch($this->type) {
53
+        switch ($this->type) {
54 54
             case self::TYPE_FIND:
55 55
                     return $this->collection->find($this->querySettings, $this->options);
56 56
                 break;
Please login to merge, or discard this patch.
src/Expression.php 1 patch
Spacing   +17 added lines, -17 removed lines patch added patch discarded remove patch
@@ -15,7 +15,7 @@  discard block
 block discarded – undo
15 15
      */
16 16
     public function __construct()
17 17
     {
18
-        $this->filters = [];
18
+        $this->filters = [ ];
19 19
     }
20 20
 
21 21
     /**
@@ -29,8 +29,8 @@  discard block
 block discarded – undo
29 29
     {
30 30
         $this->prepareFilterIndex('$and');
31 31
 
32
-        $this->filters['$and'] = array_merge(
33
-            $this->filters['$and'],
32
+        $this->filters[ '$and' ] = array_merge(
33
+            $this->filters[ '$and' ],
34 34
             $this->mapExpressions(...func_get_args())
35 35
         );
36 36
 
@@ -42,8 +42,8 @@  discard block
 block discarded – undo
42 42
      */
43 43
     private function prepareFilterIndex(string $operator)
44 44
     {
45
-        if (!isset($this->filters[$operator])) {
46
-            $this->filters[$operator] = [];
45
+        if (!isset($this->filters[ $operator ])) {
46
+            $this->filters[ $operator ] = [ ];
47 47
         }
48 48
     }
49 49
 
@@ -55,7 +55,7 @@  discard block
 block discarded – undo
55 55
     private function mapExpressions($expressions): array
56 56
     {
57 57
         return array_map(
58
-            function ($expression) {
58
+            function($expression) {
59 59
                 return $expression instanceof Expression ? $expression->getExpressionFilters() : $expression;
60 60
             },
61 61
             func_get_args()
@@ -83,8 +83,8 @@  discard block
 block discarded – undo
83 83
     {
84 84
         $this->prepareFilterIndex('$or');
85 85
 
86
-        $this->filters['$or'] = array_merge(
87
-            $this->filters['$or'],
86
+        $this->filters[ '$or' ] = array_merge(
87
+            $this->filters[ '$or' ],
88 88
             $this->mapExpressions(...func_get_args())
89 89
         );
90 90
 
@@ -103,7 +103,7 @@  discard block
 block discarded – undo
103 103
     {
104 104
         $this->prepareFilterIndex($field);
105 105
 
106
-        $this->filters[$field] = $this->operationExpression('$eq', $value);
106
+        $this->filters[ $field ] = $this->operationExpression('$eq', $value);
107 107
 
108 108
         return $this;
109 109
     }
@@ -120,7 +120,7 @@  discard block
 block discarded – undo
120 120
     {
121 121
         $this->prepareFilterIndex($field);
122 122
 
123
-        $this->filters[$field] = $this->operationExpression('$ne', $value);
123
+        $this->filters[ $field ] = $this->operationExpression('$ne', $value);
124 124
 
125 125
         return $this;
126 126
     }
@@ -138,7 +138,7 @@  discard block
 block discarded – undo
138 138
     {
139 139
         $this->prepareFilterIndex($field);
140 140
 
141
-        $this->filters[$field] = $this->operationExpression('$gt', $value);
141
+        $this->filters[ $field ] = $this->operationExpression('$gt', $value);
142 142
 
143 143
         return $this;
144 144
     }
@@ -156,7 +156,7 @@  discard block
 block discarded – undo
156 156
     {
157 157
         $this->prepareFilterIndex($field);
158 158
 
159
-        $this->filters[$field] = $this->operationExpression('$gte', $value);
159
+        $this->filters[ $field ] = $this->operationExpression('$gte', $value);
160 160
 
161 161
         return $this;
162 162
     }
@@ -174,7 +174,7 @@  discard block
 block discarded – undo
174 174
     {
175 175
         $this->prepareFilterIndex($field);
176 176
 
177
-        $this->filters[$field] = $this->operationExpression('$lt', $value);
177
+        $this->filters[ $field ] = $this->operationExpression('$lt', $value);
178 178
 
179 179
         return $this;
180 180
     }
@@ -192,7 +192,7 @@  discard block
 block discarded – undo
192 192
     {
193 193
         $this->prepareFilterIndex($field);
194 194
 
195
-        $this->filters[$field] = $this->operationExpression('$lte', $value);
195
+        $this->filters[ $field ] = $this->operationExpression('$lte', $value);
196 196
 
197 197
         return $this;
198 198
     }
@@ -209,7 +209,7 @@  discard block
 block discarded – undo
209 209
     {
210 210
         $this->prepareFilterIndex($field);
211 211
 
212
-        $this->filters[$field] = $this->operationExpression('$in', $values);
212
+        $this->filters[ $field ] = $this->operationExpression('$in', $values);
213 213
 
214 214
         return $this;
215 215
     }
@@ -226,7 +226,7 @@  discard block
 block discarded – undo
226 226
     {
227 227
         $this->prepareFilterIndex($field);
228 228
 
229
-        $this->filters[$field] = $this->operationExpression('$nin', $values);
229
+        $this->filters[ $field ] = $this->operationExpression('$nin', $values);
230 230
 
231 231
         return $this;
232 232
     }
@@ -240,6 +240,6 @@  discard block
 block discarded – undo
240 240
      */
241 241
     private function operationExpression(string $operation, $value): array
242 242
     {
243
-        return [$operation => $value];
243
+        return [ $operation => $value ];
244 244
     }
245 245
 }
Please login to merge, or discard this patch.
src/QueryBuilder.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -28,7 +28,7 @@  discard block
 block discarded – undo
28 28
         $this->collection = $collection;
29 29
         $this->queryType = Query::TYPE_FIND;
30 30
         $this->expression = new Expression();
31
-        $this->options = [];
31
+        $this->options = [ ];
32 32
     }
33 33
 
34 34
     /**
@@ -132,7 +132,7 @@  discard block
 block discarded – undo
132 132
 
133 133
     public function greaterThan(string $field, $value)
134 134
     {
135
-        $this->expression->greaterThan($field,$value);
135
+        $this->expression->greaterThan($field, $value);
136 136
 
137 137
         return $this;
138 138
     }
@@ -148,7 +148,7 @@  discard block
 block discarded – undo
148 148
 
149 149
     public function greaterEqualThan(string $field, $value)
150 150
     {
151
-        $this->expression->greaterEqualThan($field,$value);
151
+        $this->expression->greaterEqualThan($field, $value);
152 152
 
153 153
         return $this;
154 154
     }
@@ -164,7 +164,7 @@  discard block
 block discarded – undo
164 164
 
165 165
     public function lowerThan(string $field, $value)
166 166
     {
167
-        $this->expression->lowerThan($field,$value);
167
+        $this->expression->lowerThan($field, $value);
168 168
 
169 169
         return $this;
170 170
     }
@@ -180,7 +180,7 @@  discard block
 block discarded – undo
180 180
 
181 181
     public function lowerEqualThan(string $field, $value)
182 182
     {
183
-        $this->expression->lowerEqualThan($field,$value);
183
+        $this->expression->lowerEqualThan($field, $value);
184 184
 
185 185
         return $this;
186 186
     }
@@ -288,7 +288,7 @@  discard block
 block discarded – undo
288 288
         $this->setQueryOption('projection', array_fill_keys($projection, 1));
289 289
 
290 290
         if (!in_array('_id', $projection)) {
291
-            $this->options['projection']['_id'] = -1;
291
+            $this->options[ 'projection' ][ '_id' ] = -1;
292 292
         }
293 293
 
294 294
         return $this;
@@ -305,7 +305,7 @@  discard block
 block discarded – undo
305 305
      */
306 306
     public function setQueryOption(string $option, $value)
307 307
     {
308
-        $this->options[$option] = $value;
308
+        $this->options[ $option ] = $value;
309 309
 
310 310
         return $this;
311 311
     }
Please login to merge, or discard this patch.