Completed
Pull Request — master (#127)
by Abdul Malik
21:02
created
src/ReflectionClassConstant.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -119,7 +119,7 @@
 block discarded – undo
119 119
     /**
120 120
      * @inheritDoc
121 121
      */
122
-    public function getDocComment(): string|false
122
+    public function getDocComment(): string | false
123 123
     {
124 124
         $docBlock = $this->classConstantNode->getDocComment();
125 125
 
Please login to merge, or discard this patch.
src/Traits/ReflectionFunctionLikeTrait.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -71,7 +71,7 @@  discard block
 block discarded – undo
71 71
         return parent::getClosureThis();
72 72
     }
73 73
 
74
-    public function getDocComment(): string|false
74
+    public function getDocComment(): string | false
75 75
     {
76 76
         $docComment = $this->functionLikeNode->getDocComment();
77 77
 
@@ -88,12 +88,12 @@  discard block
 block discarded – undo
88 88
         return null;
89 89
     }
90 90
 
91
-    public function getExtensionName(): string|false
91
+    public function getExtensionName(): string | false
92 92
     {
93 93
         return false;
94 94
     }
95 95
 
96
-    public function getFileName(): string|false
96
+    public function getFileName(): string | false
97 97
     {
98 98
         return $this->functionLikeNode->getAttribute('fileName');
99 99
     }
@@ -106,7 +106,7 @@  discard block
 block discarded – undo
106 106
         if ($this->functionLikeNode instanceof Function_ || $this->functionLikeNode instanceof ClassMethod) {
107 107
             $functionName = $this->functionLikeNode->name->toString();
108 108
 
109
-            return $this->namespaceName ? $this->namespaceName . '\\' . $functionName : $functionName;
109
+            return $this->namespaceName ? $this->namespaceName.'\\'.$functionName : $functionName;
110 110
         }
111 111
 
112 112
         return '';
@@ -158,7 +158,7 @@  discard block
 block discarded – undo
158 158
             foreach ($this->functionLikeNode->getParams() as $parameterIndex => $parameterNode) {
159 159
                 $reflectionParameter = new ReflectionParameter(
160 160
                     $this->getName(),
161
-                    (string)$parameterNode->var->name,
161
+                    (string) $parameterNode->var->name,
162 162
                     $parameterNode,
163 163
                     $parameterIndex,
164 164
                     $this
Please login to merge, or discard this patch.
src/Traits/ReflectionClassLikeTrait.php 1 patch
Spacing   +20 added lines, -20 removed lines patch added patch discarded remove patch
@@ -147,19 +147,19 @@  discard block
 block discarded – undo
147 147
             }
148 148
         }
149 149
 
150
-        $buildString = static function (array $items, $indentLevel = 4) {
150
+        $buildString = static function(array $items, $indentLevel = 4) {
151 151
             if (!count($items)) {
152 152
                 return '';
153 153
             }
154
-            $indent = "\n" . str_repeat(' ', $indentLevel);
154
+            $indent = "\n".str_repeat(' ', $indentLevel);
155 155
 
156
-            return $indent . implode($indent, explode("\n", implode("\n", $items)));
156
+            return $indent.implode($indent, explode("\n", implode("\n", $items)));
157 157
         };
158 158
 
159
-        $buildConstants = static function (array $items, $indentLevel = 4) {
159
+        $buildConstants = static function(array $items, $indentLevel = 4) {
160 160
             $str = '';
161 161
             foreach ($items as $name => $value) {
162
-                $str .= "\n" . str_repeat(' ', $indentLevel);
162
+                $str .= "\n".str_repeat(' ', $indentLevel);
163 163
                 $str .= sprintf(
164 164
                     'Constant [ %s %s ] { %s }',
165 165
                     gettype($value),
@@ -184,8 +184,8 @@  discard block
 block discarded – undo
184 184
             ($isObject ? 'Object of class' : 'Class'),
185 185
             $modifiers,
186 186
             $this->getName(),
187
-            false !== $parentClass ? (' extends ' . $parentClass->getName()) : '',
188
-            $interfaceNames ? (' implements ' . implode(', ', $interfaceNames)) : '',
187
+            false !== $parentClass ? (' extends '.$parentClass->getName()) : '',
188
+            $interfaceNames ? (' implements '.implode(', ', $interfaceNames)) : '',
189 189
             $this->getFileName(),
190 190
             $this->getStartLine(),
191 191
             $this->getEndLine(),
@@ -226,7 +226,7 @@  discard block
 block discarded – undo
226 226
     {
227 227
         if (!isset($this->constants)) {
228 228
             $this->constants = $this->recursiveCollect(
229
-                function (array &$result, \ReflectionClass $instance) {
229
+                function(array &$result, \ReflectionClass $instance) {
230 230
                     $result += $instance->getConstants();
231 231
                 }
232 232
             );
@@ -290,7 +290,7 @@  discard block
 block discarded – undo
290 290
     /**
291 291
      * {@inheritDoc}
292 292
      */
293
-    public function getDocComment(): string|false
293
+    public function getDocComment(): string | false
294 294
     {
295 295
         $docComment = $this->classLikeNode->getDocComment();
296 296
 
@@ -307,12 +307,12 @@  discard block
 block discarded – undo
307 307
         return null;
308 308
     }
309 309
 
310
-    public function getExtensionName(): string|false
310
+    public function getExtensionName(): string | false
311 311
     {
312 312
         return false;
313 313
     }
314 314
 
315
-    public function getFileName(): string|false
315
+    public function getFileName(): string | false
316 316
     {
317 317
         return $this->classLikeNode->getAttribute('fileName');
318 318
     }
@@ -332,7 +332,7 @@  discard block
 block discarded – undo
332 332
     {
333 333
         if (!isset($this->interfaceClasses)) {
334 334
             $this->interfaceClasses = $this->recursiveCollect(
335
-                function (array &$result, \ReflectionClass $instance) {
335
+                function(array &$result, \ReflectionClass $instance) {
336 336
                     if ($instance->isInterface()) {
337 337
                         $result[$instance->name] = $instance;
338 338
                     }
@@ -372,7 +372,7 @@  discard block
 block discarded – undo
372 372
         if (!isset($this->methods)) {
373 373
             $directMethods = ReflectionMethod::collectFromClassNode($this->classLikeNode, $this);
374 374
             $parentMethods = $this->recursiveCollect(
375
-                function (array &$result, \ReflectionClass $instance, $isParent) {
375
+                function(array &$result, \ReflectionClass $instance, $isParent) {
376 376
                     $reflectionMethods = [];
377 377
                     foreach ($instance->getMethods() as $reflectionMethod) {
378 378
                         if (!$isParent || !$reflectionMethod->isPrivate()) {
@@ -437,9 +437,9 @@  discard block
 block discarded – undo
437 437
      */
438 438
     public function getName(): string
439 439
     {
440
-        $namespaceName = $this->namespaceName ? $this->namespaceName . '\\' : '';
440
+        $namespaceName = $this->namespaceName ? $this->namespaceName.'\\' : '';
441 441
 
442
-        return $namespaceName . $this->getShortName();
442
+        return $namespaceName.$this->getShortName();
443 443
     }
444 444
 
445 445
     /**
@@ -453,7 +453,7 @@  discard block
 block discarded – undo
453 453
     /**
454 454
      * {@inheritDoc}
455 455
      */
456
-    public function getParentClass(): \ReflectionClass|false
456
+    public function getParentClass(): \ReflectionClass | false
457 457
     {
458 458
         if (!isset($this->parentClass)) {
459 459
             static $extendsField = 'extends';
@@ -484,7 +484,7 @@  discard block
 block discarded – undo
484 484
         if (!isset($this->properties)) {
485 485
             $directProperties = ReflectionProperty::collectFromClassNode($this->classLikeNode, $this->getName());
486 486
             $parentProperties = $this->recursiveCollect(
487
-                function (array &$result, \ReflectionClass $instance, $isParent) {
487
+                function(array &$result, \ReflectionClass $instance, $isParent) {
488 488
                     $reflectionProperties = [];
489 489
                     foreach ($instance->getProperties() as $reflectionProperty) {
490 490
                         if (!$isParent || !$reflectionProperty->isPrivate()) {
@@ -534,7 +534,7 @@  discard block
 block discarded – undo
534 534
     /**
535 535
      * @inheritDoc
536 536
      */
537
-    public function getReflectionConstant($name): \ReflectionClassConstant|false
537
+    public function getReflectionConstant($name): \ReflectionClassConstant | false
538 538
     {
539 539
         $classConstants = $this->getReflectionConstants();
540 540
         foreach ($classConstants as $classConstant) {
@@ -557,7 +557,7 @@  discard block
 block discarded – undo
557 557
                 $this->getName()
558 558
             );
559 559
             $parentClassConstants = $this->recursiveCollect(
560
-                function (array &$result, \ReflectionClass $instance, $isParent) {
560
+                function(array &$result, \ReflectionClass $instance, $isParent) {
561 561
                     $reflectionClassConstants = [];
562 562
                     foreach ($instance->getReflectionConstants() as $reflectionClassConstant) {
563 563
                         if (!$isParent || !$reflectionClassConstant->isPrivate()) {
@@ -610,7 +610,7 @@  discard block
 block discarded – undo
610 610
                         break;
611 611
                     }
612 612
                 }
613
-                $aliases[$adaptation->newName] = $traitName . '::' . $methodName;
613
+                $aliases[$adaptation->newName] = $traitName.'::'.$methodName;
614 614
             }
615 615
         }
616 616
 
Please login to merge, or discard this patch.
src/ReflectionFileNamespace.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -165,13 +165,13 @@  discard block
 block discarded – undo
165 165
      *
166 166
      * @return string|false The doc comment if it exists, otherwise "false"
167 167
      */
168
-    public function getDocComment(): string|false
168
+    public function getDocComment(): string | false
169 169
     {
170 170
         $docComment = false;
171 171
         $comments   = $this->namespaceNode->getAttribute('comments');
172 172
 
173 173
         if ($comments) {
174
-            $docComment = (string)$comments[0];
174
+            $docComment = (string) $comments[0];
175 175
         }
176 176
 
177 177
         return $docComment;
@@ -318,7 +318,7 @@  discard block
 block discarded – undo
318 318
         foreach ($this->namespaceNode->stmts as $namespaceLevelNode) {
319 319
             if ($namespaceLevelNode instanceof ClassLike) {
320 320
                 $classShortName = $namespaceLevelNode->name->toString();
321
-                $className = $namespaceName ? $namespaceName .'\\' . $classShortName : $classShortName;
321
+                $className = $namespaceName ? $namespaceName.'\\'.$classShortName : $classShortName;
322 322
 
323 323
                 $namespaceLevelNode->setAttribute('fileName', $this->fileName);
324 324
                 $classes[$className] = new ReflectionClass($className, $namespaceLevelNode);
@@ -342,7 +342,7 @@  discard block
 block discarded – undo
342 342
         foreach ($this->namespaceNode->stmts as $namespaceLevelNode) {
343 343
             if ($namespaceLevelNode instanceof Function_) {
344 344
                 $funcShortName = $namespaceLevelNode->name->toString();
345
-                $functionName  = $namespaceName ? $namespaceName .'\\' . $funcShortName : $funcShortName;
345
+                $functionName  = $namespaceName ? $namespaceName.'\\'.$funcShortName : $funcShortName;
346 346
 
347 347
                 $namespaceLevelNode->setAttribute('fileName', $this->fileName);
348 348
                 $functions[$funcShortName] = new ReflectionFunction($functionName, $namespaceLevelNode);
@@ -382,7 +382,7 @@  discard block
 block discarded – undo
382 382
                 if ($namespaceLevelNode instanceof Expression
383 383
                     && $namespaceLevelNode->expr instanceof FuncCall
384 384
                     && $namespaceLevelNode->expr->name instanceof Name
385
-                    && (string)$namespaceLevelNode->expr->name === 'define'
385
+                    && (string) $namespaceLevelNode->expr->name === 'define'
386 386
                 ) {
387 387
                     $functionCallNode = $namespaceLevelNode->expr;
388 388
                     $expressionSolver->process($functionCallNode->args[0]->value);
Please login to merge, or discard this patch.
src/ReflectionParameter.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -123,7 +123,7 @@  discard block
 block discarded – undo
123 123
     public function __debugInfo(): array
124 124
     {
125 125
         return [
126
-            'name' => (string)$this->parameterNode->var->name,
126
+            'name' => (string) $this->parameterNode->var->name,
127 127
         ];
128 128
     }
129 129
 
@@ -149,11 +149,11 @@  discard block
 block discarded – undo
149 149
             'Parameter #%d [ %s %s%s%s$%s%s ]',
150 150
             $this->parameterIndex,
151 151
             $isOptional ? '<optional>' : '<required>',
152
-            $parameterType ? ReflectionType::convertToDisplayType($parameterType) . ' ' : '',
152
+            $parameterType ? ReflectionType::convertToDisplayType($parameterType).' ' : '',
153 153
             $this->isVariadic() ? '...' : '',
154 154
             $this->isPassedByReference() ? '&' : '',
155 155
             $this->getName(),
156
-            ($isOptional && $hasDefaultValue) ? (' = ' . $defaultValue) : ''
156
+            ($isOptional && $hasDefaultValue) ? (' = '.$defaultValue) : ''
157 157
         );
158 158
     }
159 159
 
@@ -248,7 +248,7 @@  discard block
 block discarded – undo
248 248
     /**
249 249
      * {@inheritDoc}
250 250
      */
251
-    public function getDefaultValueConstantName(): null|string
251
+    public function getDefaultValueConstantName(): null | string
252 252
     {
253 253
         if (!$this->isDefaultValueAvailable()) {
254 254
             throw new ReflectionException('Internal error: Failed to retrieve the default value');
@@ -262,7 +262,7 @@  discard block
 block discarded – undo
262 262
      */
263 263
     public function getName(): string
264 264
     {
265
-        return (string)$this->parameterNode->var->name;
265
+        return (string) $this->parameterNode->var->name;
266 266
     }
267 267
 
268 268
     /**
Please login to merge, or discard this patch.
src/ReflectionProperty.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -123,7 +123,7 @@  discard block
 block discarded – undo
123 123
 
124 124
             [, $defaultValueFromDisplay] = explode(' = ', $originalDisplay);
125 125
 
126
-            $defaultValueDisplay = '= ' . rtrim($defaultValueFromDisplay, ' ]' . PHP_EOL);
126
+            $defaultValueDisplay = '= '.rtrim($defaultValueFromDisplay, ' ]'.PHP_EOL);
127 127
 
128 128
             if (is_array($defaultValue) && str_starts_with($defaultValueDisplay, '= [')) {
129 129
                 $defaultValueDisplay .= ']';
@@ -149,7 +149,7 @@  discard block
 block discarded – undo
149 149
     /**
150 150
      * @inheritDoc
151 151
      */
152
-    public function getDocComment(): string|false
152
+    public function getDocComment(): string | false
153 153
     {
154 154
         $docBlock = $this->propertyTypeNode->getDocComment();
155 155
 
Please login to merge, or discard this patch.