Completed
Push — master ( 1fb800...df78b5 )
by Marco
11:03 queued 11s
created
src/SourceLocator/Type/EvaledCodeSourceLocator.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -52,13 +52,13 @@
 block discarded – undo
52 52
 
53 53
     private function getInternalReflectionClass(Identifier $identifier) : ?ReflectionClass
54 54
     {
55
-        if (! $identifier->isClass()) {
55
+        if (!$identifier->isClass()) {
56 56
             return null;
57 57
         }
58 58
 
59 59
         $name = $identifier->getName();
60 60
 
61
-        if (! (class_exists($name, false) || interface_exists($name, false) || trait_exists($name, false))) {
61
+        if (!(class_exists($name, false) || interface_exists($name, false) || trait_exists($name, false))) {
62 62
             return null; // not an available internal class
63 63
         }
64 64
 
Please login to merge, or discard this patch.
src/SourceLocator/Type/PhpInternalSourceLocator.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -58,13 +58,13 @@  discard block
 block discarded – undo
58 58
 
59 59
     private function getInternalReflectionClass(Identifier $identifier) : ?CoreReflectionClass
60 60
     {
61
-        if (! $identifier->isClass()) {
61
+        if (!$identifier->isClass()) {
62 62
             return null;
63 63
         }
64 64
 
65 65
         $name = $identifier->getName();
66 66
 
67
-        if (! (class_exists($name, false) || interface_exists($name, false) || trait_exists($name, false))) {
67
+        if (!(class_exists($name, false) || interface_exists($name, false) || trait_exists($name, false))) {
68 68
             return null; // not an available internal class
69 69
         }
70 70
 
@@ -95,13 +95,13 @@  discard block
 block discarded – undo
95 95
 
96 96
     private function getInternalReflectionFunction(Identifier $identifier) : ?CoreReflectionFunction
97 97
     {
98
-        if (! $identifier->isFunction()) {
98
+        if (!$identifier->isFunction()) {
99 99
             return null;
100 100
         }
101 101
 
102 102
         $name = $identifier->getName();
103 103
 
104
-        if (! function_exists($name)) {
104
+        if (!function_exists($name)) {
105 105
             return null;
106 106
         }
107 107
 
Please login to merge, or discard this patch.
src/SourceLocator/SourceStubber/ReflectionSourceStubber.php 1 patch
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -78,7 +78,7 @@  discard block
 block discarded – undo
78 78
         $this->addConstants($classNode, $classReflection);
79 79
         $this->addMethods($classNode, $classReflection);
80 80
 
81
-        if (! $classReflection->inNamespace()) {
81
+        if (!$classReflection->inNamespace()) {
82 82
             return $this->generateStub($classNode);
83 83
         }
84 84
 
@@ -129,12 +129,12 @@  discard block
 block discarded – undo
129 129
 
130 130
     private function addClassModifiers(Class_ $classNode, CoreReflectionClass $classReflection) : void
131 131
     {
132
-        if (! $classReflection->isInterface() && $classReflection->isAbstract()) {
132
+        if (!$classReflection->isInterface() && $classReflection->isAbstract()) {
133 133
             // Interface \Iterator is interface and abstract
134 134
             $classNode->makeAbstract();
135 135
         }
136 136
 
137
-        if (! $classReflection->isFinal()) {
137
+        if (!$classReflection->isFinal()) {
138 138
             return;
139 139
         }
140 140
 
@@ -193,7 +193,7 @@  discard block
 block discarded – undo
193 193
         $defaultProperties = $classReflection->getDefaultProperties();
194 194
 
195 195
         foreach ($classReflection->getProperties() as $propertyReflection) {
196
-            if (! $this->isPropertyDeclaredInClass($propertyReflection, $classReflection)) {
196
+            if (!$this->isPropertyDeclaredInClass($propertyReflection, $classReflection)) {
197 197
                 continue;
198 198
             }
199 199
 
@@ -239,7 +239,7 @@  discard block
 block discarded – undo
239 239
             $propertyNode->makeProtected();
240 240
         }
241 241
 
242
-        if (! $propertyReflection->isPrivate()) {
242
+        if (!$propertyReflection->isPrivate()) {
243 243
             return;
244 244
         }
245 245
 
@@ -282,7 +282,7 @@  discard block
 block discarded – undo
282 282
     private function addMethods(Declaration $classNode, CoreReflectionClass $classReflection) : void
283 283
     {
284 284
         foreach ($classReflection->getMethods() as $methodReflection) {
285
-            if (! $this->isMethodDeclaredInClass($methodReflection, $classReflection)) {
285
+            if (!$this->isMethodDeclaredInClass($methodReflection, $classReflection)) {
286 286
                 continue;
287 287
             }
288 288
 
@@ -347,7 +347,7 @@  discard block
 block discarded – undo
347 347
             $methodNode->makePrivate();
348 348
         }
349 349
 
350
-        if (! $methodReflection->returnsReference()) {
350
+        if (!$methodReflection->returnsReference()) {
351 351
             return;
352 352
         }
353 353
 
@@ -361,7 +361,7 @@  discard block
 block discarded – undo
361 361
 
362 362
             $this->addParameterModifiers($parameterReflection, $parameterNode);
363 363
 
364
-            if ($parameterReflection->isOptional() && ! $parameterReflection->isVariadic()) {
364
+            if ($parameterReflection->isOptional() && !$parameterReflection->isVariadic()) {
365 365
                 $parameterNode->setDefault($this->parameterDefaultValue($parameterReflection, $functionReflectionAbstract));
366 366
             }
367 367
 
@@ -407,13 +407,13 @@  discard block
 block discarded – undo
407 407
      */
408 408
     private function formatType(CoreReflectionType $type) : NodeAbstract
409 409
     {
410
-        $name     = (string) $type;
410
+        $name     = (string)$type;
411 411
         $nameNode = $type->isBuiltin() || in_array($name, ['self', 'parent'], true) ? new Name($name) : new FullyQualified($name);
412 412
         return $type->allowsNull() ? new NullableType($nameNode) : $nameNode;
413 413
     }
414 414
 
415 415
     private function generateStub(Builder $builder) : string
416 416
     {
417
-        return "<?php\n\n" . $this->prettyPrinter->prettyPrint([$builder->getNode()]) . "\n";
417
+        return "<?php\n\n".$this->prettyPrinter->prettyPrint([$builder->getNode()])."\n";
418 418
     }
419 419
 }
Please login to merge, or discard this patch.
src/Reflection/ReflectionFunctionAbstract.php 1 patch
Spacing   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -113,7 +113,7 @@  discard block
 block discarded – undo
113 113
             // When we find the first parameter that does not have a default,
114 114
             // flip the flag as all params for this are no longer optional
115 115
             // EVEN if they have a default value
116
-            if (! $hasDefault) {
116
+            if (!$hasDefault) {
117 117
                 $overallOptionalFlag = false;
118 118
             }
119 119
 
@@ -127,11 +127,11 @@  discard block
 block discarded – undo
127 127
      */
128 128
     public function getName() : string
129 129
     {
130
-        if (! $this->inNamespace()) {
130
+        if (!$this->inNamespace()) {
131 131
             return $this->getShortName();
132 132
         }
133 133
 
134
-        return $this->getNamespaceName() . '\\' . $this->getShortName();
134
+        return $this->getNamespaceName().'\\'.$this->getShortName();
135 135
     }
136 136
 
137 137
     /**
@@ -155,7 +155,7 @@  discard block
 block discarded – undo
155 155
      */
156 156
     public function getNamespaceName() : string
157 157
     {
158
-        if (! $this->inNamespace()) {
158
+        if (!$this->inNamespace()) {
159 159
             return '';
160 160
         }
161 161
 
@@ -187,8 +187,8 @@  discard block
 block discarded – undo
187 187
     {
188 188
         return count(array_filter(
189 189
             $this->getParameters(),
190
-            static function (ReflectionParameter $p) : bool {
191
-                return ! $p->isOptional();
190
+            static function(ReflectionParameter $p) : bool {
191
+                return !$p->isOptional();
192 192
             }
193 193
         ));
194 194
     }
@@ -283,7 +283,7 @@  discard block
 block discarded – undo
283 283
      */
284 284
     public function isUserDefined() : bool
285 285
     {
286
-        return ! $this->isInternal();
286
+        return !$this->isInternal();
287 287
     }
288 288
 
289 289
     public function getExtensionName() : ?string
@@ -324,7 +324,7 @@  discard block
 block discarded – undo
324 324
                 return true;
325 325
             }
326 326
 
327
-            if (! is_array($nodeProperty)) {
327
+            if (!is_array($nodeProperty)) {
328 328
                 continue;
329 329
             }
330 330
 
@@ -410,10 +410,10 @@  discard block
 block discarded – undo
410 410
         }
411 411
 
412 412
         if ($returnType instanceof NullableType) {
413
-            return ReflectionType::createFromTypeAndReflector((string) $returnType->type, true, $this->reflector);
413
+            return ReflectionType::createFromTypeAndReflector((string)$returnType->type, true, $this->reflector);
414 414
         }
415 415
 
416
-        return ReflectionType::createFromTypeAndReflector((string) $returnType, false, $this->reflector);
416
+        return ReflectionType::createFromTypeAndReflector((string)$returnType, false, $this->reflector);
417 417
     }
418 418
 
419 419
     /**
@@ -520,7 +520,7 @@  discard block
 block discarded – undo
520 520
      */
521 521
     public function setBodyFromString(string $newBody) : void
522 522
     {
523
-        $this->node->stmts = $this->loadStaticParser()->parse('<?php ' . $newBody);
523
+        $this->node->stmts = $this->loadStaticParser()->parse('<?php '.$newBody);
524 524
     }
525 525
 
526 526
     /**
@@ -537,7 +537,7 @@  discard block
 block discarded – undo
537 537
     {
538 538
         // This slightly confusing code simply type-checks the $sourceLocators
539 539
         // array by unpacking them and splatting them in the closure.
540
-        $validator         = static function (Node ...$node) : array {
540
+        $validator         = static function(Node ...$node) : array {
541 541
             return $node;
542 542
         };
543 543
         $this->node->stmts = $validator(...$nodes);
@@ -563,7 +563,7 @@  discard block
 block discarded – undo
563 563
                 throw new LogicException('PhpParser left an "Error" node in the parameters AST, this should NOT happen');
564 564
             }
565 565
 
566
-            if (! is_string($paramNode->var->name) || strtolower($paramNode->var->name) !== $lowerName) {
566
+            if (!is_string($paramNode->var->name) || strtolower($paramNode->var->name) !== $lowerName) {
567 567
                 continue;
568 568
             }
569 569
 
Please login to merge, or discard this patch.
src/SourceLocator/SourceStubber/PhpStormStubsSourceStubber.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -29,8 +29,8 @@  discard block
 block discarded – undo
29 29
 {
30 30
     private const BUILDER_OPTIONS    = ['shortArraySyntax' => true];
31 31
     private const SEARCH_DIRECTORIES = [
32
-        __DIR__ . '/../../../../../jetbrains/phpstorm-stubs',
33
-        __DIR__ . '/../../../vendor/jetbrains/phpstorm-stubs',
32
+        __DIR__.'/../../../../../jetbrains/phpstorm-stubs',
33
+        __DIR__.'/../../../vendor/jetbrains/phpstorm-stubs',
34 34
     ];
35 35
 
36 36
     /** @var Parser */
@@ -114,7 +114,7 @@  discard block
 block discarded – undo
114 114
             return null;
115 115
         }
116 116
 
117
-        return "<?php\n\n" . $this->prettyPrinter->prettyPrint([$node]) . "\n";
117
+        return "<?php\n\n".$this->prettyPrinter->prettyPrint([$node])."\n";
118 118
     }
119 119
 
120 120
     private function getClassNodeVisitor(CoreReflectionClass $classReflection) : NodeVisitorAbstract
@@ -203,7 +203,7 @@  discard block
 block discarded – undo
203 203
 
204 204
         $extensionDirectory = sprintf('%s/%s', $this->getStubsDirectory(), $extensionName);
205 205
 
206
-        if (! is_dir($extensionDirectory)) {
206
+        if (!is_dir($extensionDirectory)) {
207 207
             return [];
208 208
         }
209 209
 
Please login to merge, or discard this patch.