Completed
Pull Request — master (#97)
by
unknown
02:17
created
src/ReflectionFileNamespace.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -182,7 +182,7 @@  discard block
 block discarded – undo
182 182
         $comments   = $this->namespaceNode->getAttribute('comments');
183 183
 
184 184
         if ($comments) {
185
-            $docComment = (string)$comments[0];
185
+            $docComment = (string) $comments[0];
186 186
         }
187 187
 
188 188
         return $docComment;
@@ -355,7 +355,7 @@  discard block
 block discarded – undo
355 355
         foreach ($this->namespaceNode->stmts as $namespaceLevelNode) {
356 356
             if ($namespaceLevelNode instanceof ClassLike) {
357 357
                 $classShortName = $namespaceLevelNode->name->toString();
358
-                $className = $namespaceName ? $namespaceName .'\\' . $classShortName : $classShortName;
358
+                $className = $namespaceName ? $namespaceName.'\\'.$classShortName : $classShortName;
359 359
 
360 360
                 $namespaceLevelNode->setAttribute('fileName', $this->fileName);
361 361
                 $classes[$className] = new ReflectionClass($className, $namespaceLevelNode);
@@ -379,7 +379,7 @@  discard block
 block discarded – undo
379 379
         foreach ($this->namespaceNode->stmts as $namespaceLevelNode) {
380 380
             if ($namespaceLevelNode instanceof Function_) {
381 381
                 $funcShortName = $namespaceLevelNode->name->toString();
382
-                $functionName  = $namespaceName ? $namespaceName .'\\' . $funcShortName : $funcShortName;
382
+                $functionName  = $namespaceName ? $namespaceName.'\\'.$funcShortName : $funcShortName;
383 383
 
384 384
                 $namespaceLevelNode->setAttribute('fileName', $this->fileName);
385 385
                 $functions[$funcShortName] = new ReflectionFunction($functionName, $namespaceLevelNode);
@@ -419,7 +419,7 @@  discard block
 block discarded – undo
419 419
                 if ($namespaceLevelNode instanceof Expression
420 420
                     && $namespaceLevelNode->expr instanceof FuncCall
421 421
                     && $namespaceLevelNode->expr->name instanceof Name
422
-                    && (string)$namespaceLevelNode->expr->name === 'define'
422
+                    && (string) $namespaceLevelNode->expr->name === 'define'
423 423
                 ) {
424 424
                     $functionCallNode = $namespaceLevelNode->expr;
425 425
                     $expressionSolver->process($functionCallNode->args[0]->value);
Please login to merge, or discard this patch.
src/polyfill.php 1 patch
Unused Use Statements   -2 removed lines patch added patch discarded remove patch
@@ -8,8 +8,6 @@
 block discarded – undo
8 8
  * with this source code in the file LICENSE.
9 9
  */
10 10
 
11
-use Go\ParserReflection\ReflectionClass;
12
-
13 11
 /**
14 12
  * This file is for ployfilling classes not defined in all supported
15 13
  * versions of PHP, (i.e. PHP < 7).
Please login to merge, or discard this patch.
src/Traits/ReflectionClassLikeTrait.php 1 patch
Spacing   +16 added lines, -16 removed lines patch added patch discarded remove patch
@@ -139,17 +139,17 @@  discard block
 block discarded – undo
139 139
             }
140 140
         }
141 141
 
142
-        $buildString = function (array $items, $indentLevel = 4) {
142
+        $buildString = function(array $items, $indentLevel = 4) {
143 143
             if (!count($items)) {
144 144
                 return '';
145 145
             }
146
-            $indent = "\n" . str_repeat(' ', $indentLevel);
147
-            return $indent . implode($indent, explode("\n", implode("\n", $items)));
146
+            $indent = "\n".str_repeat(' ', $indentLevel);
147
+            return $indent.implode($indent, explode("\n", implode("\n", $items)));
148 148
         };
149
-        $buildConstants = function (array $items, $indentLevel = 4) {
149
+        $buildConstants = function(array $items, $indentLevel = 4) {
150 150
             $str = '';
151 151
             foreach ($items as $name => $value) {
152
-                $str .= "\n" . str_repeat(' ', $indentLevel);
152
+                $str .= "\n".str_repeat(' ', $indentLevel);
153 153
                 $str .= sprintf(
154 154
                     'Constant [ %s %s ] { %s }',
155 155
                     gettype($value),
@@ -173,8 +173,8 @@  discard block
 block discarded – undo
173 173
             ($isObject ? 'Object of class' : 'Class'),
174 174
             $modifiers,
175 175
             $this->getName(),
176
-            false !== $parentClass ? (' extends ' . $parentClass->getName()) : '',
177
-            $interfaceNames ? (' implements ' . implode(', ', $interfaceNames)) : '',
176
+            false !== $parentClass ? (' extends '.$parentClass->getName()) : '',
177
+            $interfaceNames ? (' implements '.implode(', ', $interfaceNames)) : '',
178 178
             $this->getFileName(),
179 179
             $this->getStartLine(),
180 180
             $this->getEndLine(),
@@ -214,7 +214,7 @@  discard block
 block discarded – undo
214 214
     public function getConstants()
215 215
     {
216 216
         if (!isset($this->constants)) {
217
-            $this->constants = $this->recursiveCollect(function (array &$result, \ReflectionClass $instance) {
217
+            $this->constants = $this->recursiveCollect(function(array &$result, \ReflectionClass $instance) {
218 218
                 $result += $instance->getConstants();
219 219
             });
220 220
             $this->collectSelfConstants();
@@ -251,7 +251,7 @@  discard block
 block discarded – undo
251 251
         $staticOrder   = [true, false];
252 252
         foreach ($staticOrder as $shouldBeStatic) {
253 253
             foreach ($properties as $property) {
254
-                $isStaticProperty     = $property->isStatic();
254
+                $isStaticProperty = $property->isStatic();
255 255
                 if ($shouldBeStatic !== $isStaticProperty) {
256 256
                     continue;
257 257
                 }
@@ -315,7 +315,7 @@  discard block
 block discarded – undo
315 315
     public function getInterfaces()
316 316
     {
317 317
         if (!isset($this->interfaceClasses)) {
318
-            $this->interfaceClasses = $this->recursiveCollect(function (array &$result, \ReflectionClass $instance) {
318
+            $this->interfaceClasses = $this->recursiveCollect(function(array &$result, \ReflectionClass $instance) {
319 319
                 if ($instance->isInterface()) {
320 320
                     $result[$instance->name] = $instance;
321 321
                 }
@@ -353,7 +353,7 @@  discard block
 block discarded – undo
353 353
     {
354 354
         if (!isset($this->methods)) {
355 355
             $directMethods = ReflectionMethod::collectFromClassNode($this->classLikeNode, $this);
356
-            $parentMethods = $this->recursiveCollect(function (array &$result, \ReflectionClass $instance, $isParent) {
356
+            $parentMethods = $this->recursiveCollect(function(array &$result, \ReflectionClass $instance, $isParent) {
357 357
                 $reflectionMethods = [];
358 358
                 foreach ($instance->getMethods() as $reflectionMethod) {
359 359
                     if (!$isParent || !$reflectionMethod->isPrivate()) {
@@ -423,9 +423,9 @@  discard block
 block discarded – undo
423 423
      */
424 424
     public function getName()
425 425
     {
426
-        $namespaceName = $this->namespaceName ? $this->namespaceName . '\\' : '';
426
+        $namespaceName = $this->namespaceName ? $this->namespaceName.'\\' : '';
427 427
 
428
-        return $namespaceName . $this->getShortName();
428
+        return $namespaceName.$this->getShortName();
429 429
     }
430 430
 
431 431
     /**
@@ -469,7 +469,7 @@  discard block
 block discarded – undo
469 469
     {
470 470
         if (!isset($this->properties)) {
471 471
             $directProperties = ReflectionProperty::collectFromClassNode($this->classLikeNode, $this->getName());
472
-            $parentProperties = $this->recursiveCollect(function (array &$result, \ReflectionClass $instance, $isParent) {
472
+            $parentProperties = $this->recursiveCollect(function(array &$result, \ReflectionClass $instance, $isParent) {
473 473
                 $reflectionProperties = [];
474 474
                 foreach ($instance->getProperties() as $reflectionProperty) {
475 475
                     if (!$isParent || !$reflectionProperty->isPrivate()) {
@@ -536,7 +536,7 @@  discard block
 block discarded – undo
536 536
     {
537 537
         if (!isset($this->classConstants)) {
538 538
             $directClassConstants = ReflectionClassConstant::collectFromClassNode($this->classLikeNode, $this->getName());
539
-            $parentClassConstants = $this->recursiveCollect(function (array &$result, \ReflectionClass $instance, $isParent) {
539
+            $parentClassConstants = $this->recursiveCollect(function(array &$result, \ReflectionClass $instance, $isParent) {
540 540
                 $reflectionClassConstants = [];
541 541
                 foreach ($instance->getReflectionConstants() as $reflectionClassConstant) {
542 542
                     if (!$isParent || !$reflectionClassConstant->isPrivate()) {
@@ -588,7 +588,7 @@  discard block
 block discarded – undo
588 588
                         break;
589 589
                     }
590 590
                 }
591
-                $aliases[$adaptation->newName] = $traitName . '::'. $methodName;
591
+                $aliases[$adaptation->newName] = $traitName.'::'.$methodName;
592 592
             }
593 593
         }
594 594
 
Please login to merge, or discard this patch.