Completed
Push — master ( fc2e3c...51369d )
by Alessandro
01:46
created
src/Expression.php 1 patch
Spacing   +8 added lines, -8 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
     /**
@@ -27,8 +27,8 @@  discard block
 block discarded – undo
27 27
     {
28 28
         $this->prepareOperator('$and');
29 29
 
30
-        $this->filters['$and'] = array_merge(
31
-            $this->filters['$and'],
30
+        $this->filters[ '$and' ] = array_merge(
31
+            $this->filters[ '$and' ],
32 32
             $this->mapExpressions(...func_get_args())
33 33
         );
34 34
 
@@ -44,8 +44,8 @@  discard block
 block discarded – undo
44 44
     {
45 45
         $this->prepareOperator('$or');
46 46
 
47
-        $this->filters['$or'] = array_merge(
48
-            $this->filters['$or'],
47
+        $this->filters[ '$or' ] = array_merge(
48
+            $this->filters[ '$or' ],
49 49
             $this->mapExpressions(...func_get_args())
50 50
         );
51 51
 
@@ -65,8 +65,8 @@  discard block
 block discarded – undo
65 65
      */
66 66
     private function prepareOperator(string $operator)
67 67
     {
68
-        if (!isset($this->filters[$operator])) {
69
-            $this->filters[$operator] = [];
68
+        if (!isset($this->filters[ $operator ])) {
69
+            $this->filters[ $operator ] = [ ];
70 70
         }
71 71
     }
72 72
 
@@ -78,7 +78,7 @@  discard block
 block discarded – undo
78 78
     private function mapExpressions($expressions): array
79 79
     {
80 80
         return array_map(
81
-            function ($expression) {
81
+            function($expression) {
82 82
                 return $expression instanceof Expression ? $expression->getExpressionFilters() : $expression;
83 83
             },
84 84
             func_get_args()
Please login to merge, or discard this patch.
src/Builder.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -26,7 +26,7 @@  discard block
 block discarded – undo
26 26
         $this->collection = $collection;
27 27
         $this->queryType = Query::TYPE_FIND;
28 28
         $this->expression = new Expression();
29
-        $this->options = [];
29
+        $this->options = [ ];
30 30
     }
31 31
 
32 32
     /**
@@ -142,7 +142,7 @@  discard block
 block discarded – undo
142 142
         $this->setQueryOption('projection', array_fill_keys($projection, 1));
143 143
 
144 144
         if (!in_array('_id', $projection)) {
145
-            $this->options['projection']['_id'] = -1;
145
+            $this->options[ 'projection' ][ '_id' ] = -1;
146 146
         }
147 147
 
148 148
         return $this;
@@ -156,7 +156,7 @@  discard block
 block discarded – undo
156 156
      */
157 157
     public function setQueryOption(string $option, $value)
158 158
     {
159
-        $this->options[$option] = $value;
159
+        $this->options[ $option ] = $value;
160 160
 
161 161
         return $this;
162 162
     }
Please login to merge, or discard this patch.
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.