Passed
Push — v1 ( 7efdab...83c840 )
by Andrew
11:53 queued 07:55
created
src/autocompletes/CraftApiAutocomplete.php 1 patch
Spacing   +27 added lines, -27 removed lines patch added patch discarded remove patch
@@ -147,10 +147,10 @@  discard block
 block discarded – undo
147 147
                             $value = json_encode(array_keys($value));
148 148
                         }
149 149
                         $this->addCompleteItem(new CompleteItem([
150
-                            'detail' => (string)$value,
150
+                            'detail' => (string) $value,
151 151
                             'kind' => $kind,
152
-                            'label' => (string)$key,
153
-                            'insertText' => (string)$key,
152
+                            'label' => (string) $key,
153
+                            'insertText' => (string) $key,
154 154
                         ]), $path);
155 155
                         break;
156 156
                 }
@@ -222,11 +222,11 @@  discard block
 block discarded – undo
222 222
             }
223 223
         }
224 224
         $this->addCompleteItem(new CompleteItem([
225
-            'detail' => (string)$className,
226
-            'documentation' => (string)$docs,
225
+            'detail' => (string) $className,
226
+            'documentation' => (string) $docs,
227 227
             'kind' => CompleteItemKind::ClassKind,
228
-            'label' => (string)$name,
229
-            'insertText' => (string)$name,
228
+            'label' => (string) $name,
229
+            'insertText' => (string) $name,
230 230
         ]), $path);
231 231
     }
232 232
 
@@ -276,7 +276,7 @@  discard block
 block discarded – undo
276 276
             // Exclude some properties
277 277
             $propertyAllowed = true;
278 278
             foreach (self::EXCLUDED_PROPERTY_REGEXES as $excludePattern) {
279
-                $pattern = '`' . $excludePattern . '`i';
279
+                $pattern = '`'.$excludePattern.'`i';
280 280
                 if (preg_match($pattern, $propertyName) === 1) {
281 281
                     $propertyAllowed = false;
282 282
                 }
@@ -346,12 +346,12 @@  discard block
 block discarded – undo
346 346
                 $thisPath = trim(implode('.', [$path, $propertyName]), '.');
347 347
                 $label = $propertyName;
348 348
                 $this->addCompleteItem(new CompleteItem([
349
-                    'detail' => (string)$detail,
350
-                    'documentation' => (string)$docs,
349
+                    'detail' => (string) $detail,
350
+                    'documentation' => (string) $docs,
351 351
                     'kind' => $customField ? CompleteItemKind::FieldKind : CompleteItemKind::PropertyKind,
352
-                    'label' => (string)$label,
353
-                    'insertText' => (string)$label,
354
-                    'sortText' => (string)$sortPrefix . (string)$label,
352
+                    'label' => (string) $label,
353
+                    'insertText' => (string) $label,
354
+                    'sortText' => (string) $sortPrefix.(string) $label,
355 355
                 ]), $thisPath);
356 356
                 // Recurse through if this is an object
357 357
                 if (isset($object->$propertyName) && is_object($object->$propertyName)) {
@@ -381,7 +381,7 @@  discard block
 block discarded – undo
381 381
             // Exclude some properties
382 382
             $methodAllowed = true;
383 383
             foreach (self::EXCLUDED_METHOD_REGEXES as $excludePattern) {
384
-                $pattern = '`' . $excludePattern . '`i';
384
+                $pattern = '`'.$excludePattern.'`i';
385 385
                 if (preg_match($pattern, $methodName) === 1) {
386 386
                     $methodAllowed = false;
387 387
                 }
@@ -403,7 +403,7 @@  discard block
 block discarded – undo
403 403
                         }
404 404
                     }
405 405
                 }
406
-                $detail = $methodName . '(';
406
+                $detail = $methodName.'(';
407 407
                 $params = $reflectionMethod->getParameters();
408 408
                 $paramList = [];
409 409
                 foreach ($params as $param) {
@@ -413,20 +413,20 @@  discard block
 block discarded – undo
413 413
                             $unionTypes = $reflectionType->getTypes();
414 414
                             $typeName = '';
415 415
                             foreach ($unionTypes as $unionType) {
416
-                                $typeName .= '|' . $unionType->getName();
416
+                                $typeName .= '|'.$unionType->getName();
417 417
                             }
418 418
                             $typeName = trim($typeName, '|');
419
-                            $paramList[] = $typeName . ': ' . '$' . $param->getName();
419
+                            $paramList[] = $typeName.': '.'$'.$param->getName();
420 420
                         } else {
421
-                            $paramList[] = $param->getType()->getName() . ': ' . '$' . $param->getName();
421
+                            $paramList[] = $param->getType()->getName().': '.'$'.$param->getName();
422 422
                         }
423 423
                     } else {
424
-                        $paramList[] = '$' . $param->getName();
424
+                        $paramList[] = '$'.$param->getName();
425 425
                     }
426 426
                 }
427
-                $detail .= implode(', ', $paramList) . ')';
427
+                $detail .= implode(', ', $paramList).')';
428 428
                 $thisPath = trim(implode('.', [$path, $methodName]), '.');
429
-                $label = $methodName . '()';
429
+                $label = $methodName.'()';
430 430
                 $docsPreamble = '';
431 431
                 // Figure out the type
432 432
                 if ($docblock) {
@@ -434,18 +434,18 @@  discard block
 block discarded – undo
434 434
                     if ($tags) {
435 435
                         $docsPreamble = "Parameters:\n\n";
436 436
                         foreach ($tags as $tag) {
437
-                            $docsPreamble .= $tag . "\n";
437
+                            $docsPreamble .= $tag."\n";
438 438
                         }
439 439
                         $docsPreamble .= "\n";
440 440
                     }
441 441
                 }
442 442
                 $this->addCompleteItem(new CompleteItem([
443
-                    'detail' => (string)$detail,
444
-                    'documentation' => (string)$docsPreamble . (string)$docs,
443
+                    'detail' => (string) $detail,
444
+                    'documentation' => (string) $docsPreamble.(string) $docs,
445 445
                     'kind' => CompleteItemKind::MethodKind,
446
-                    'label' => (string)$label,
447
-                    'insertText' => (string)$label,
448
-                    'sortText' => '~~~' . (string)$label,
446
+                    'label' => (string) $label,
447
+                    'insertText' => (string) $label,
448
+                    'sortText' => '~~~'.(string) $label,
449 449
                 ]), $thisPath);
450 450
             }
451 451
         }
Please login to merge, or discard this patch.