Passed
Push — v1 ( 238213...7252af )
by Andrew
12:06 queued 08:03
created
src/autocompletes/CraftApiAutocomplete.php 1 patch
Spacing   +27 added lines, -27 removed lines patch added patch discarded remove patch
@@ -142,10 +142,10 @@  discard block
 block discarded – undo
142 142
                             $kind = CompleteItemKind::ConstantKind;
143 143
                         }
144 144
                         $this->addCompleteItem(new CompleteItem([
145
-                            'detail' => (string)$value,
145
+                            'detail' => (string) $value,
146 146
                             'kind' => $kind,
147
-                            'label' => (string)$key,
148
-                            'insertText' => (string)$key,
147
+                            'label' => (string) $key,
148
+                            'insertText' => (string) $key,
149 149
                         ]), $path);
150 150
                         break;
151 151
                 }
@@ -217,11 +217,11 @@  discard block
 block discarded – undo
217 217
             }
218 218
         }
219 219
         $this->addCompleteItem(new CompleteItem([
220
-            'detail' => (string)$className,
221
-            'documentation' => (string)$docs,
220
+            'detail' => (string) $className,
221
+            'documentation' => (string) $docs,
222 222
             'kind' => CompleteItemKind::ClassKind,
223
-            'label' => (string)$name,
224
-            'insertText' => (string)$name,
223
+            'label' => (string) $name,
224
+            'insertText' => (string) $name,
225 225
         ]), $path);
226 226
     }
227 227
 
@@ -271,7 +271,7 @@  discard block
 block discarded – undo
271 271
             // Exclude some properties
272 272
             $propertyAllowed = true;
273 273
             foreach (self::EXCLUDED_PROPERTY_REGEXES as $excludePattern) {
274
-                $pattern = '`' . $excludePattern . '`i';
274
+                $pattern = '`'.$excludePattern.'`i';
275 275
                 if (preg_match($pattern, $propertyName) === 1) {
276 276
                     $propertyAllowed = false;
277 277
                 }
@@ -341,12 +341,12 @@  discard block
 block discarded – undo
341 341
                 $thisPath = trim(implode('.', [$path, $propertyName]), '.');
342 342
                 $label = $propertyName;
343 343
                 $this->addCompleteItem(new CompleteItem([
344
-                    'detail' => (string)$detail,
345
-                    'documentation' => (string)$docs,
344
+                    'detail' => (string) $detail,
345
+                    'documentation' => (string) $docs,
346 346
                     'kind' => $customField ? CompleteItemKind::FieldKind : CompleteItemKind::PropertyKind,
347
-                    'label' => (string)$label,
348
-                    'insertText' => (string)$label,
349
-                    'sortText' => (string)$sortPrefix . (string)$label,
347
+                    'label' => (string) $label,
348
+                    'insertText' => (string) $label,
349
+                    'sortText' => (string) $sortPrefix.(string) $label,
350 350
                 ]), $thisPath);
351 351
                 // Recurse through if this is an object
352 352
                 if (isset($object->$propertyName) && is_object($object->$propertyName)) {
@@ -376,7 +376,7 @@  discard block
 block discarded – undo
376 376
             // Exclude some properties
377 377
             $methodAllowed = true;
378 378
             foreach (self::EXCLUDED_METHOD_REGEXES as $excludePattern) {
379
-                $pattern = '`' . $excludePattern . '`i';
379
+                $pattern = '`'.$excludePattern.'`i';
380 380
                 if (preg_match($pattern, $methodName) === 1) {
381 381
                     $methodAllowed = false;
382 382
                 }
@@ -398,7 +398,7 @@  discard block
 block discarded – undo
398 398
                         }
399 399
                     }
400 400
                 }
401
-                $detail = $methodName . '(';
401
+                $detail = $methodName.'(';
402 402
                 $params = $reflectionMethod->getParameters();
403 403
                 $paramList = [];
404 404
                 foreach ($params as $param) {
@@ -408,20 +408,20 @@  discard block
 block discarded – undo
408 408
                             $unionTypes = $reflectionType->getTypes();
409 409
                             $typeName = '';
410 410
                             foreach ($unionTypes as $unionType) {
411
-                                $typeName .= '|' . $unionType->getName();
411
+                                $typeName .= '|'.$unionType->getName();
412 412
                             }
413 413
                             $typeName = trim($typeName, '|');
414
-                            $paramList[] = $typeName . ': ' . '$' . $param->getName();
414
+                            $paramList[] = $typeName.': '.'$'.$param->getName();
415 415
                         } else {
416
-                            $paramList[] = $param->getType()->getName() . ': ' . '$' . $param->getName();
416
+                            $paramList[] = $param->getType()->getName().': '.'$'.$param->getName();
417 417
                         }
418 418
                     } else {
419
-                        $paramList[] = '$' . $param->getName();
419
+                        $paramList[] = '$'.$param->getName();
420 420
                     }
421 421
                 }
422
-                $detail .= implode(', ', $paramList) . ')';
422
+                $detail .= implode(', ', $paramList).')';
423 423
                 $thisPath = trim(implode('.', [$path, $methodName]), '.');
424
-                $label = $methodName . '()';
424
+                $label = $methodName.'()';
425 425
                 $docsPreamble = '';
426 426
                 // Figure out the type
427 427
                 if ($docblock) {
@@ -429,18 +429,18 @@  discard block
 block discarded – undo
429 429
                     if ($tags) {
430 430
                         $docsPreamble = "Parameters:\n\n";
431 431
                         foreach ($tags as $tag) {
432
-                            $docsPreamble .= $tag . "\n";
432
+                            $docsPreamble .= $tag."\n";
433 433
                         }
434 434
                         $docsPreamble .= "\n";
435 435
                     }
436 436
                 }
437 437
                 $this->addCompleteItem(new CompleteItem([
438
-                    'detail' => (string)$detail,
439
-                    'documentation' => (string)$docsPreamble . (string)$docs,
438
+                    'detail' => (string) $detail,
439
+                    'documentation' => (string) $docsPreamble.(string) $docs,
440 440
                     'kind' => CompleteItemKind::MethodKind,
441
-                    'label' => (string)$label,
442
-                    'insertText' => (string)$label,
443
-                    'sortText' => '~~~' . (string)$label,
441
+                    'label' => (string) $label,
442
+                    'insertText' => (string) $label,
443
+                    'sortText' => '~~~'.(string) $label,
444 444
                 ]), $thisPath);
445 445
             }
446 446
         }
Please login to merge, or discard this patch.