Completed
Pull Request — master (#82)
by Loren
02:45 queued 01:04
created
src/ReflectionFunction.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -106,14 +106,14 @@
 block discarded – undo
106 106
 
107 107
         return sprintf(
108 108
             $reflectionFormat,
109
-            $this->getDocComment() ? $this->getDocComment() . "\n" : '',
109
+            $this->getDocComment() ? $this->getDocComment()."\n" : '',
110 110
             $this->getName(),
111 111
             $this->getFileName(),
112 112
             $this->getStartLine(),
113 113
             $this->getEndLine(),
114 114
             count($this->getParameters()),
115
-            array_reduce($this->getParameters(), function ($str, ReflectionParameter $param) {
116
-                return $str . "\n    " . $param;
115
+            array_reduce($this->getParameters(), function($str, ReflectionParameter $param) {
116
+                return $str."\n    ".$param;
117 117
             }, '')
118 118
         );
119 119
     }
Please login to merge, or discard this patch.
src/Instrument/PathResolver.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -50,7 +50,7 @@
 block discarded – undo
50 50
 
51 51
         $isRelative = !$pathScheme && ($path[0] !== '/') && ($path[1] !== ':');
52 52
         if ($isRelative) {
53
-            $path = getcwd() . DIRECTORY_SEPARATOR . $path;
53
+            $path = getcwd().DIRECTORY_SEPARATOR.$path;
54 54
         }
55 55
 
56 56
         // resolve path parts (single dot, double dot and double delimiters)
Please login to merge, or discard this patch.
src/ReflectionMethod.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -95,12 +95,12 @@
 block discarded – undo
95 95
         $paramString = '';
96 96
         $identation  = str_repeat(' ', 4);
97 97
         foreach ($methodParameters as $methodParameter) {
98
-            $paramString .= "\n{$identation}" . $methodParameter;
98
+            $paramString .= "\n{$identation}".$methodParameter;
99 99
         }
100 100
 
101 101
         return sprintf(
102 102
             "%sMethod [ <user%s%s%s>%s%s%s %s method %s ] {\n  @@ %s %d - %d{$paramFormat}{$returnFormat}\n}\n",
103
-            $this->getDocComment() ? $this->getDocComment() . "\n" : '',
103
+            $this->getDocComment() ? $this->getDocComment()."\n" : '',
104 104
             $prototype ? ", overwrites {$prototypeClass}, prototype {$prototypeClass}" : '',
105 105
             $this->isConstructor() ? ', ctor' : '',
106 106
             $this->isDestructor() ? ', dtor' : '',
Please login to merge, or discard this patch.
src/bootstrap.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -17,4 +17,4 @@
 block discarded – undo
17 17
  */
18 18
 ReflectionEngine::init(new ComposerLocator());
19 19
 
20
-require(__DIR__ . '/polyfill.php');
20
+require(__DIR__.'/polyfill.php');
Please login to merge, or discard this patch.
src/ReflectionFileNamespace.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -180,7 +180,7 @@  discard block
 block discarded – undo
180 180
         $comments   = $this->namespaceNode->getAttribute('comments');
181 181
 
182 182
         if ($comments) {
183
-            $docComment = (string)$comments[0];
183
+            $docComment = (string) $comments[0];
184 184
         }
185 185
 
186 186
         return $docComment;
@@ -327,7 +327,7 @@  discard block
 block discarded – undo
327 327
         foreach ($this->namespaceNode->stmts as $namespaceLevelNode) {
328 328
             if ($namespaceLevelNode instanceof ClassLike) {
329 329
                 $classShortName = $namespaceLevelNode->name;
330
-                $className = $namespaceName ? $namespaceName .'\\' . $classShortName : $classShortName;
330
+                $className = $namespaceName ? $namespaceName.'\\'.$classShortName : $classShortName;
331 331
 
332 332
                 $namespaceLevelNode->setAttribute('fileName', $this->fileName);
333 333
                 $classes[$className] = new ReflectionClass($className, $namespaceLevelNode);
@@ -351,7 +351,7 @@  discard block
 block discarded – undo
351 351
         foreach ($this->namespaceNode->stmts as $namespaceLevelNode) {
352 352
             if ($namespaceLevelNode instanceof Function_) {
353 353
                 $funcShortName = $namespaceLevelNode->name;
354
-                $functionName  = $namespaceName ? $namespaceName .'\\' . $funcShortName : $funcShortName;
354
+                $functionName  = $namespaceName ? $namespaceName.'\\'.$funcShortName : $funcShortName;
355 355
 
356 356
                 $namespaceLevelNode->setAttribute('fileName', $this->fileName);
357 357
                 $functions[$funcShortName] = new ReflectionFunction($functionName, $namespaceLevelNode);
@@ -390,7 +390,7 @@  discard block
 block discarded – undo
390 390
             foreach ($this->namespaceNode->stmts as $namespaceLevelNode) {
391 391
                 if ($namespaceLevelNode instanceof FuncCall
392 392
                     && $namespaceLevelNode->name instanceof Name
393
-                    && (string)$namespaceLevelNode->name === 'define'
393
+                    && (string) $namespaceLevelNode->name === 'define'
394 394
                 ) {
395 395
                     $expressionSolver->process($namespaceLevelNode->args[0]->value);
396 396
                     $constantName = $expressionSolver->getValue();
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
@@ -128,11 +128,11 @@  discard block
 block discarded – undo
128 128
         if ($hasDefaultValue) {
129 129
             $defaultValue = $this->getDefaultValue();
130 130
             if (is_string($defaultValue) && strlen($defaultValue) > 15) {
131
-                $defaultValue = substr($defaultValue, 0, 15) . '...';
131
+                $defaultValue = substr($defaultValue, 0, 15).'...';
132 132
             }
133 133
             /* @see https://3v4l.org/DJOEb for behaviour changes */
134 134
             if (is_double($defaultValue) && fmod($defaultValue, 1.0) === 0.0) {
135
-                $defaultValue = (int)$defaultValue;
135
+                $defaultValue = (int) $defaultValue;
136 136
             }
137 137
 
138 138
             $defaultValue = str_replace('\\\\', '\\', var_export($defaultValue, true));
@@ -142,11 +142,11 @@  discard block
 block discarded – undo
142 142
             'Parameter #%d [ %s %s%s%s$%s%s ]',
143 143
             $this->parameterIndex,
144 144
             $isOptional ? '<optional>' : '<required>',
145
-            $parameterType ? ReflectionType::convertToDisplayType($parameterType) . ' ' : '',
145
+            $parameterType ? ReflectionType::convertToDisplayType($parameterType).' ' : '',
146 146
             $this->isVariadic() ? '...' : '',
147 147
             $this->isPassedByReference() ? '&' : '',
148 148
             $this->getName(),
149
-            ($isOptional && $hasDefaultValue) ? (' = ' . $defaultValue) : ''
149
+            ($isOptional && $hasDefaultValue) ? (' = '.$defaultValue) : ''
150 150
         );
151 151
     }
152 152
 
@@ -196,7 +196,7 @@  discard block
 block discarded – undo
196 196
 
197 197
                 throw new ReflectionException("Can not resolve a class name for parameter");
198 198
             }
199
-            $className   = $parameterType->toString();
199
+            $className = $parameterType->toString();
200 200
             $classOrInterfaceExists = class_exists($className, false) || interface_exists($className, false);
201 201
 
202 202
             return $classOrInterfaceExists ? new \ReflectionClass($className) : new ReflectionClass($className);
Please login to merge, or discard this patch.
src/ValueResolver/NodeExpressionResolver.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -141,7 +141,7 @@  discard block
 block discarded – undo
141 141
     protected function resolveScalarMagicConstMethod()
142 142
     {
143 143
         if ($this->context instanceof \ReflectionMethod) {
144
-            $fullName = $this->context->getDeclaringClass()->name . '::' . $this->context->getShortName();
144
+            $fullName = $this->context->getDeclaringClass()->name.'::'.$this->context->getShortName();
145 145
 
146 146
             return $fullName;
147 147
         }
@@ -228,13 +228,13 @@  discard block
 block discarded – undo
228 228
 
229 229
         if (!$isFQNConstant) {
230 230
             if (method_exists($this->context, 'getFileName')) {
231
-                $fileName      = $this->context->getFileName();
231
+                $fileName = $this->context->getFileName();
232 232
                 if ($fileName !== false) {
233 233
                     $namespaceName = $this->resolveScalarMagicConstNamespace();
234 234
                     $fileNamespace = new ReflectionFileNamespace($fileName, $namespaceName);
235 235
                     if ($fileNamespace->hasConstant($constantName)) {
236 236
                         $constantValue = $fileNamespace->getConstant($constantName);
237
-                        $constantName  = $fileNamespace->getName() . '\\' . $constantName;
237
+                        $constantName  = $fileNamespace->getName().'\\'.$constantName;
238 238
                         $isResolved    = true;
239 239
                     }
240 240
                 }
@@ -262,7 +262,7 @@  discard block
 block discarded – undo
262 262
                 $reason = 'Unable';
263 263
                 if ($classToReflect instanceof Expr) {
264 264
                     $methodName = $this->getDispatchMethodFor($classToReflect);
265
-                    $reason = "Method " . __CLASS__ . "::{$methodName}() not found trying";
265
+                    $reason = "Method ".__CLASS__."::{$methodName}() not found trying";
266 266
                 }
267 267
                 throw new ReflectionException("$reason to resolve class constant.");
268 268
             }
@@ -279,7 +279,7 @@  discard block
 block discarded – undo
279 279
         }
280 280
 
281 281
         $this->isConstant = true;
282
-        $this->constantName = (string)$classToReflect . '::' . $constantName;
282
+        $this->constantName = (string) $classToReflect.'::'.$constantName;
283 283
 
284 284
         return $refClass->getConstant($constantName);
285 285
     }
@@ -363,7 +363,7 @@  discard block
 block discarded – undo
363 363
 
364 364
     protected function resolveExprBinaryOpConcat(Expr\BinaryOp\Concat $node)
365 365
     {
366
-        return $this->resolve($node->left) . $this->resolve($node->right);
366
+        return $this->resolve($node->left).$this->resolve($node->right);
367 367
     }
368 368
 
369 369
     protected function resolveExprTernary(Expr\Ternary $node)
@@ -447,7 +447,7 @@  discard block
 block discarded – undo
447 447
     private function getDispatchMethodFor(Node $node)
448 448
     {
449 449
         $nodeType = $node->getType();
450
-        return 'resolve' . str_replace('_', '', $nodeType);
450
+        return 'resolve'.str_replace('_', '', $nodeType);
451 451
     }
452 452
 
453 453
     /**
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
@@ -138,7 +138,7 @@  discard block
 block discarded – undo
138 138
         if ($this->functionLikeNode instanceof Function_ || $this->functionLikeNode instanceof ClassMethod) {
139 139
             $functionName = $this->functionLikeNode->name;
140 140
 
141
-            return $this->namespaceName ? $this->namespaceName . '\\' . $functionName : $functionName;
141
+            return $this->namespaceName ? $this->namespaceName.'\\'.$functionName : $functionName;
142 142
         }
143 143
 
144 144
         return false;
@@ -229,7 +229,7 @@  discard block
 block discarded – undo
229 229
      */
230 230
     public function getReturnType()
231 231
     {
232
-        $isBuiltin  = false;
232
+        $isBuiltin = false;
233 233
         if ($this->functionLikeNode) {
234 234
             $returnType = $this->functionLikeNode->getReturnType();
235 235
             $isNullable = $returnType instanceof NullableType;
@@ -255,7 +255,7 @@  discard block
 block discarded – undo
255 255
             }
256 256
             $isNullable = $nativeType->allowsNull();
257 257
             $isBuiltin = $nativeType->isBuiltin();
258
-            $returnType = (string)$nativeType;
258
+            $returnType = (string) $nativeType;
259 259
         }
260 260
 
261 261
         return new ReflectionType($returnType, $isNullable, $isBuiltin);
@@ -482,9 +482,9 @@  discard block
 block discarded – undo
482 482
         }
483 483
         if (method_exists($orig, 'hasType') && $orig->hasType()) {
484 484
             $typeRef = $orig->getType();
485
-            $stringType = ltrim((string)$typeRef, '?'); // ltrim() is precautionary.
485
+            $stringType = ltrim((string) $typeRef, '?'); // ltrim() is precautionary.
486 486
             if (PHP_VERSION_ID >= 70100 && $typeRef->allowsNull()) {
487
-                $stringType = '?' . $stringType;
487
+                $stringType = '?'.$stringType;
488 488
                 $nullableImplied = true;
489 489
             }
490 490
             $builder->setTypeHint($stringType);
Please login to merge, or discard this patch.
src/ReflectionType.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -85,7 +85,7 @@  discard block
 block discarded – undo
85 85
             'int'  => 'integer',
86 86
             'bool' => 'boolean'
87 87
         ];
88
-        $displayType = (string)$type;
88
+        $displayType = (string) $type;
89 89
         if (isset($typeMap[$displayType])) {
90 90
             $displayType = $typeMap[$displayType];
91 91
         }
@@ -108,7 +108,7 @@  discard block
 block discarded – undo
108 108
     public function wasIncluded()
109 109
     {
110 110
         return
111
-            $this->isBuiltin()                   ||
111
+            $this->isBuiltin() ||
112 112
             interface_exists($this->type, false) ||
113 113
             trait_exists($this->type, false) ||
114 114
             class_exists($this->type, false);
Please login to merge, or discard this patch.