Passed
Push — master ( 81b17d...e4aaaf )
by Giacomo
03:59 queued 18s
created
src/Extensions/MongoCollection.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -18,7 +18,7 @@  discard block
 block discarded – undo
18 18
                 return false;
19 19
             }
20 20
         })->first();
21
-        if (! $out) {//Handler 404 Object Not Found
21
+        if (!$out) {//Handler 404 Object Not Found
22 22
             $obj_name = get_class($this->first());
23 23
             $message = __('error.'.$obj_name);
24 24
             abort(404, $message);
@@ -40,7 +40,7 @@  discard block
 block discarded – undo
40 40
                 return true;
41 41
             }
42 42
         })->first();
43
-        if (! $out) {//Handler 404 Object Not Found
43
+        if (!$out) {//Handler 404 Object Not Found
44 44
             $obj_name = get_class($this->first());
45 45
             $message = __('error.'.$obj_name);
46 46
             abort(404, $message);
Please login to merge, or discard this patch.
src/Console/DropCollection.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -45,7 +45,7 @@  discard block
 block discarded – undo
45 45
 
46 46
         $model = $this->getModel($modelPath);
47 47
 
48
-        if (! is_null($model)) {
48
+        if (!is_null($model)) {
49 49
             $model = $model->all();
50 50
 
51 51
             $count = $model->count();
@@ -55,7 +55,7 @@  discard block
 block discarded – undo
55 55
                 for ($i = 0; $i <= $count - 1; $i++) {
56 56
                     $bar->advance();
57 57
                     $model[$i]->destroyWithSync();
58
-                    $this->line($i + 1 .') Destroy item document with id #'.$model[$i]->getId());
58
+                    $this->line($i + 1.') Destroy item document with id #'.$model[$i]->getId());
59 59
                 }
60 60
             } else {
61 61
                 $this->warn('No record found on collection '.strtolower($collection_name));
Please login to merge, or discard this patch.
src/Traits/MainMongoTrait.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -119,7 +119,7 @@  discard block
 block discarded – undo
119 119
      */
120 120
     public function checkPropertyExistence($obj, string $EOkey, $method = '', $model = '')
121 121
     {
122
-        if (! property_exists($obj, $EOkey)) {
122
+        if (!property_exists($obj, $EOkey)) {
123 123
             $msg = 'Error - '.$EOkey.' attribute not found on obj '.json_encode($obj).' during save of model: '.$model.' and attribute: '.$method;
124 124
             throw new Exception($msg);
125 125
         }
@@ -132,7 +132,7 @@  discard block
 block discarded – undo
132 132
      */
133 133
     public function checkArrayExistence($arr, string $key)
134 134
     {
135
-        if (! Arr::has($arr, $key)) {
135
+        if (!Arr::has($arr, $key)) {
136 136
             $msg = ('Error - '.$key.' attribute not found on obj '.json_encode($arr));
137 137
             throw new Exception($msg);
138 138
         }
@@ -145,7 +145,7 @@  discard block
 block discarded – undo
145 145
      */
146 146
     private function checkRequestExistence(Request $request, string $key)
147 147
     {
148
-        if (! $request->has($key)) {
148
+        if (!$request->has($key)) {
149 149
             $msg = ('Error - '.$key.' attribute not found in Request '.json_encode($request->all()));
150 150
             throw new Exception($msg);
151 151
         }
@@ -158,7 +158,7 @@  discard block
 block discarded – undo
158 158
      */
159 159
     public function getIsSkippable($request_has_key, $hasTarget = false)
160 160
     {
161
-        return ! $request_has_key && $this->getHasPartialRequest() && ! $hasTarget;
161
+        return !$request_has_key && $this->getHasPartialRequest() && !$hasTarget;
162 162
     }
163 163
 
164 164
     /**
Please login to merge, or discard this patch.
src/Traits/ModelAdditionalMethod.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -32,7 +32,7 @@  discard block
 block discarded – undo
32 32
      */
33 33
     public function getMongoRelation(): array
34 34
     {
35
-        if (! empty($this->mongoRelation)) {
35
+        if (!empty($this->mongoRelation)) {
36 36
             return $this->mongoRelation;
37 37
         } else {
38 38
             return [];
@@ -391,7 +391,7 @@  discard block
 block discarded – undo
391 391
         if ($is_EO) {
392 392
             $objs[] = $this->getObjValueToBeSaved($method, '', false);
393 393
         } elseif ($is_EM) {
394
-            if (! is_null($this->$method) > 0) {
394
+            if (!is_null($this->$method) > 0) {
395 395
                 foreach ($this->$method as $value) {
396 396
                     $obj = new stdClass;
397 397
                     $obj->ref_id = $value->ref_id;
Please login to merge, or discard this patch.
src/Traits/RelationshipMongoTrait.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -61,7 +61,7 @@  discard block
 block discarded – undo
61 61
 
62 62
             $is_embeds_has_to_be_updated = $request->has($key);
63 63
 
64
-            if (! is_null($value) && ! ($value == '') && ! ($value == '[]')) {
64
+            if (!is_null($value) && !($value == '') && !($value == '[]')) {
65 65
                 $objs = json_decode($value);
66 66
             } else {
67 67
                 $objs = getArrayWithEmptyObj($model, $is_EO, $is_EM);
@@ -81,7 +81,7 @@  discard block
 block discarded – undo
81 81
                     }
82 82
                 }
83 83
 
84
-                if (! empty($objs)) {
84
+                if (!empty($objs)) {
85 85
                     if ($is_EM) {
86 86
                         $this->tempEM = [];
87 87
                     }
@@ -185,7 +185,7 @@  discard block
 block discarded – undo
185 185
     {
186 186
         if ($is_EO) {
187 187
             $embedObj = $this->$method;
188
-            if (! is_null($embedObj)) {
188
+            if (!is_null($embedObj)) {
189 189
                 $target_id = $embedObj->ref_id;
190 190
                 $this->handleSubTarget($target_id, $modelTarget, $methodOnTarget, $is_EO_target, $is_EM_target);
191 191
             }
@@ -208,7 +208,7 @@  discard block
 block discarded – undo
208 208
         if ($is_EM_target) {
209 209
             $target = new $modelTarget;
210 210
             $target = $target->all()->where('id', $target_id)->first();
211
-            if (! is_null($target)) {
211
+            if (!is_null($target)) {
212 212
                 $new_values = [];
213 213
                 foreach ($target->$methodOnTarget as $temp) {
214 214
                     if ($temp->ref_id !== $this->getId()) {
@@ -244,7 +244,7 @@  discard block
 block discarded – undo
244 244
         $EOitems = $embedObj->getItems();
245 245
         //Current Obj Create
246 246
         foreach ($EOitems as $EOkey => $item) {
247
-            if (! is_null($obj)) {
247
+            if (!is_null($obj)) {
248 248
                 $is_ML = isML($item);
249 249
                 $is_MD = isMD($item);
250 250
                 $this->checkPropertyExistence($obj, $EOkey, $method, $model);
@@ -293,7 +293,7 @@  discard block
 block discarded – undo
293 293
     private function processEmbedOnTargetCollection($modelTarget, $obj, $methodOnTarget, $modelOnTarget, bool $is_EO_target, bool $is_EM_target)
294 294
     {
295 295
         $modelToBeSync = $this->getModelTobeSync($modelTarget, $obj);
296
-        if (! is_null($modelToBeSync)) {
296
+        if (!is_null($modelToBeSync)) {
297 297
             $miniModel = $this->getEmbedModel($modelOnTarget);
298 298
             $modelToBeSync->updateRelationWithSync($miniModel, $methodOnTarget, $is_EO_target, $is_EM_target);
299 299
             //TODO:Sync target on level > 1
Please login to merge, or discard this patch.
src/syncUtils.php 1 patch
Spacing   +23 added lines, -23 removed lines patch added patch discarded remove patch
@@ -5,7 +5,7 @@  discard block
 block discarded – undo
5 5
 use Illuminate\Support\Facades\Config;
6 6
 use Jenssegers\Mongodb\Eloquent\Model;
7 7
 
8
-if (! function_exists('getTranslatedContent')) {
8
+if (!function_exists('getTranslatedContent')) {
9 9
 
10 10
     /**
11 11
      * @param array $mlCollection
@@ -17,7 +17,7 @@  discard block
 block discarded – undo
17 17
         //Get current Lang
18 18
         $cl = Config::get('app.locale');
19 19
 
20
-        if (is_array($mlCollection) && (array_key_exists('en_EN', $mlCollection) || array_key_exists('it_IT', $mlCollection) || ! is_null($mlCollection || ! isset($destination)))) {
20
+        if (is_array($mlCollection) && (array_key_exists('en_EN', $mlCollection) || array_key_exists('it_IT', $mlCollection) || !is_null($mlCollection || !isset($destination)))) {
21 21
             return $mlCollection[$cl];
22 22
         } else {
23 23
             return '';
@@ -25,7 +25,7 @@  discard block
 block discarded – undo
25 25
     }
26 26
 }
27 27
 
28
-if (! function_exists('cl')) {
28
+if (!function_exists('cl')) {
29 29
 
30 30
     /**
31 31
      * @return string current Lang
@@ -37,7 +37,7 @@  discard block
 block discarded – undo
37 37
     }
38 38
 }
39 39
 
40
-if (! function_exists('ml')) {
40
+if (!function_exists('ml')) {
41 41
     //save a localized field
42 42
     /**
43 43
      * @param array $destination
@@ -55,7 +55,7 @@  discard block
 block discarded – undo
55 55
     }
56 56
 }
57 57
 
58
-if (! function_exists('isML')) {
58
+if (!function_exists('isML')) {
59 59
     function isML($value)
60 60
     {
61 61
         if (array_key_exists('is-ml', $value)) {
@@ -66,7 +66,7 @@  discard block
 block discarded – undo
66 66
     }
67 67
 }
68 68
 
69
-if (! function_exists('isMD')) {
69
+if (!function_exists('isMD')) {
70 70
     function isMD($value)
71 71
     {
72 72
         if (array_key_exists('is-md', $value)) {
@@ -76,7 +76,7 @@  discard block
 block discarded – undo
76 76
         }
77 77
     }
78 78
 }
79
-if (! function_exists('is_EM')) {
79
+if (!function_exists('is_EM')) {
80 80
     function is_EM($value)
81 81
     {
82 82
         if ($value === 'EmbedsMany') {
@@ -87,7 +87,7 @@  discard block
 block discarded – undo
87 87
     }
88 88
 }
89 89
 
90
-if (! function_exists('is_EO')) {
90
+if (!function_exists('is_EO')) {
91 91
     function is_EO($value)
92 92
     {
93 93
         if ($value === 'EmbedsOne') {
@@ -98,7 +98,7 @@  discard block
 block discarded – undo
98 98
     }
99 99
 }
100 100
 
101
-if (! function_exists('is_HM')) {
101
+if (!function_exists('is_HM')) {
102 102
     function is_HM($value)
103 103
     {
104 104
         if ($value === 'HasMany') {
@@ -109,7 +109,7 @@  discard block
 block discarded – undo
109 109
     }
110 110
 }
111 111
 
112
-if (! function_exists('is_HO')) {
112
+if (!function_exists('is_HO')) {
113 113
     function is_HO($value)
114 114
     {
115 115
         if ($value === 'HasOne') {
@@ -120,7 +120,7 @@  discard block
 block discarded – undo
120 120
     }
121 121
 }
122 122
 
123
-if (! function_exists('isEditable')) {
123
+if (!function_exists('isEditable')) {
124 124
     function isEditable($value)
125 125
     {
126 126
         if (array_key_exists('is-editable', $value)) {
@@ -131,7 +131,7 @@  discard block
 block discarded – undo
131 131
     }
132 132
 }
133 133
 
134
-if (! function_exists('hasTarget')) {
134
+if (!function_exists('hasTarget')) {
135 135
     function hasTarget($value)
136 136
     {
137 137
         if (array_key_exists('has-target', $value)) {
@@ -141,7 +141,7 @@  discard block
 block discarded – undo
141 141
         }
142 142
     }
143 143
 }
144
-if (! function_exists('isFillable')) {
144
+if (!function_exists('isFillable')) {
145 145
     function isFillable($value, $event)
146 146
     {
147 147
         if ($event === 'add') {
@@ -152,7 +152,7 @@  discard block
 block discarded – undo
152 152
     }
153 153
 }
154 154
 
155
-if (! function_exists('getRequestToBeSync')) {
155
+if (!function_exists('getRequestToBeSync')) {
156 156
     /**
157 157
      * @param $ref_id
158 158
      * @param $modelOnTarget
@@ -183,7 +183,7 @@  discard block
 block discarded – undo
183 183
     }
184 184
 }
185 185
 
186
-if (! function_exists('getPrimaryRequest')) {
186
+if (!function_exists('getPrimaryRequest')) {
187 187
     /**
188 188
      * @param string $request
189 189
      *
@@ -191,7 +191,7 @@  discard block
 block discarded – undo
191 191
      */
192 192
     function getPrimaryRequest($request)
193 193
     {
194
-        if (! is_null($request)) {
194
+        if (!is_null($request)) {
195 195
             $arr = [];
196 196
             $categorylistdataJson = $request;
197 197
             $categorylistdataArr = json_decode($categorylistdataJson);
@@ -210,7 +210,7 @@  discard block
 block discarded – undo
210 210
     }
211 211
 }
212 212
 
213
-if (! function_exists('getAID')) {
213
+if (!function_exists('getAID')) {
214 214
     /**
215 215
      * @param Model $model
216 216
      * @return string
@@ -224,7 +224,7 @@  discard block
 block discarded – undo
224 224
     }
225 225
 }
226 226
 
227
-if (! function_exists('isRequestReadyToBeProcessed')) {
227
+if (!function_exists('isRequestReadyToBeProcessed')) {
228 228
     function isRequestReadyToBeProcessed(Request $request)
229 229
     {
230 230
         $requests = $request->all();
@@ -241,14 +241,14 @@  discard block
 block discarded – undo
241 241
     }
242 242
 }
243 243
 
244
-if (! function_exists('removeSubCollectionInput')) {
244
+if (!function_exists('removeSubCollectionInput')) {
245 245
     function removeSubCollectionInput(Request $request)
246 246
     {
247 247
         return $request;
248 248
     }
249 249
 }
250 250
 
251
-if (! function_exists('prepareRequest')) {
251
+if (!function_exists('prepareRequest')) {
252 252
 
253 253
     /**
254 254
      * @param Request $request
@@ -270,7 +270,7 @@  discard block
 block discarded – undo
270 270
     }
271 271
 }
272 272
 
273
-if (! function_exists('getArrayWithEmptyObj')) {
273
+if (!function_exists('getArrayWithEmptyObj')) {
274 274
 
275 275
     /**
276 276
      * @param $model
@@ -297,7 +297,7 @@  discard block
 block discarded – undo
297 297
     }
298 298
 }
299 299
 
300
-if (! function_exists('getCounterForRelationships')) {
300
+if (!function_exists('getCounterForRelationships')) {
301 301
 
302 302
     /**
303 303
      * @param $method
@@ -316,7 +316,7 @@  discard block
 block discarded – undo
316 316
         }
317 317
     }
318 318
 
319
-    if (! function_exists('getTypeOnTarget')) {
319
+    if (!function_exists('getTypeOnTarget')) {
320 320
         function getTypeOnTarget($relation)
321 321
         {
322 322
             return Arr::has($relation, 'typeOnTarget') ? Arr::get($relation, 'typeOnTarget') : 'EmbedsMany';
Please login to merge, or discard this patch.