@@ -50,8 +50,8 @@ discard block |
||
| 50 | 50 | * Current reflection context for parsing |
| 51 | 51 | */ |
| 52 | 52 | private |
| 53 | - \ReflectionClass|\ReflectionFunction|\ReflectionMethod|\ReflectionClassConstant| |
|
| 54 | - \ReflectionParameter|\ReflectionAttribute|\ReflectionProperty|ReflectionFileNamespace|null $context; |
|
| 53 | + \ReflectionClass | \ReflectionFunction | \ReflectionMethod | \ReflectionClassConstant | |
|
| 54 | + \ReflectionParameter | \ReflectionAttribute | \ReflectionProperty | ReflectionFileNamespace | null $context; |
|
| 55 | 55 | |
| 56 | 56 | /** |
| 57 | 57 | * Flag if given expression is constant |
@@ -123,7 +123,7 @@ discard block |
||
| 123 | 123 | $node->name = new Name(ltrim($constantNodeName->toString(), '\\')); |
| 124 | 124 | } else { |
| 125 | 125 | // For relative names we would like to add namespace prefix |
| 126 | - $node->name = new Name($this->resolveScalarMagicConstNamespace() . '\\' . $constantNodeName->toString()); |
|
| 126 | + $node->name = new Name($this->resolveScalarMagicConstNamespace().'\\'.$constantNodeName->toString()); |
|
| 127 | 127 | } |
| 128 | 128 | } |
| 129 | 129 | // All long array nodes are pretty-printed by PHP in short format |
@@ -168,7 +168,7 @@ discard block |
||
| 168 | 168 | |
| 169 | 169 | $methodName = $this->getDispatchMethodFor($node); |
| 170 | 170 | if (!method_exists($this, $methodName)) { |
| 171 | - throw new ReflectionException("Could not find handler for the " . __CLASS__ . "::{$methodName} method"); |
|
| 171 | + throw new ReflectionException("Could not find handler for the ".__CLASS__."::{$methodName} method"); |
|
| 172 | 172 | } |
| 173 | 173 | $value = $this->$methodName($node); |
| 174 | 174 | } finally { |
@@ -255,7 +255,7 @@ discard block |
||
| 255 | 255 | throw new ReflectionException("Could not resolve __METHOD__ without method context"); |
| 256 | 256 | } |
| 257 | 257 | |
| 258 | - return $this->context->getDeclaringClass()->name . '::' . $this->context->getShortName(); |
|
| 258 | + return $this->context->getDeclaringClass()->name.'::'.$this->context->getShortName(); |
|
| 259 | 259 | } |
| 260 | 260 | |
| 261 | 261 | /** |
@@ -361,7 +361,7 @@ discard block |
||
| 361 | 361 | $fileNamespace = new ReflectionFileNamespace($fileName, $namespaceName); |
| 362 | 362 | if ($fileNamespace->hasConstant($constantName)) { |
| 363 | 363 | $constantValue = $fileNamespace->getConstant($constantName); |
| 364 | - $constantName = $fileNamespace->getName() . '\\' . $constantName; |
|
| 364 | + $constantName = $fileNamespace->getName().'\\'.$constantName; |
|
| 365 | 365 | $isResolved = true; |
| 366 | 366 | } |
| 367 | 367 | } |
@@ -370,7 +370,7 @@ discard block |
||
| 370 | 370 | if (!$isResolved && defined($constantName)) { |
| 371 | 371 | $constantValue = constant($constantName); |
| 372 | 372 | if (!$isFQNConstant) { |
| 373 | - $constantName = $this->context->getNamespaceName() . '\\' . $constantName; |
|
| 373 | + $constantName = $this->context->getNamespaceName().'\\'.$constantName; |
|
| 374 | 374 | } |
| 375 | 375 | } |
| 376 | 376 | |
@@ -416,7 +416,7 @@ discard block |
||
| 416 | 416 | |
| 417 | 417 | $this->isConstant = true; |
| 418 | 418 | $this->isConstExpr = true; |
| 419 | - $this->constantName = $classToReflectNodeName . '::' . $constantName; |
|
| 419 | + $this->constantName = $classToReflectNodeName.'::'.$constantName; |
|
| 420 | 420 | |
| 421 | 421 | return $refClass->getConstant($constantName); |
| 422 | 422 | } |
@@ -436,27 +436,27 @@ discard block |
||
| 436 | 436 | return $result; |
| 437 | 437 | } |
| 438 | 438 | |
| 439 | - protected function resolveExprBinaryOpPlus(Expr\BinaryOp\Plus $node): int|float|array |
|
| 439 | + protected function resolveExprBinaryOpPlus(Expr\BinaryOp\Plus $node): int | float | array |
|
| 440 | 440 | { |
| 441 | 441 | return $this->resolve($node->left) + $this->resolve($node->right); |
| 442 | 442 | } |
| 443 | 443 | |
| 444 | - protected function resolveExprBinaryOpMinus(Expr\BinaryOp\Minus $node): int|float |
|
| 444 | + protected function resolveExprBinaryOpMinus(Expr\BinaryOp\Minus $node): int | float |
|
| 445 | 445 | { |
| 446 | 446 | return $this->resolve($node->left) - $this->resolve($node->right); |
| 447 | 447 | } |
| 448 | 448 | |
| 449 | - protected function resolveExprBinaryOpMul(Expr\BinaryOp\Mul $node): int|float |
|
| 449 | + protected function resolveExprBinaryOpMul(Expr\BinaryOp\Mul $node): int | float |
|
| 450 | 450 | { |
| 451 | 451 | return $this->resolve($node->left) * $this->resolve($node->right); |
| 452 | 452 | } |
| 453 | 453 | |
| 454 | - protected function resolveExprBinaryOpPow(Expr\BinaryOp\Pow $node): int|float |
|
| 454 | + protected function resolveExprBinaryOpPow(Expr\BinaryOp\Pow $node): int | float |
|
| 455 | 455 | { |
| 456 | 456 | return $this->resolve($node->left) ** $this->resolve($node->right); |
| 457 | 457 | } |
| 458 | 458 | |
| 459 | - protected function resolveExprBinaryOpDiv(Expr\BinaryOp\Div $node): int|float |
|
| 459 | + protected function resolveExprBinaryOpDiv(Expr\BinaryOp\Div $node): int | float |
|
| 460 | 460 | { |
| 461 | 461 | return $this->resolve($node->left) / $this->resolve($node->right); |
| 462 | 462 | } |
@@ -476,7 +476,7 @@ discard block |
||
| 476 | 476 | return !$this->resolve($node->expr); |
| 477 | 477 | } |
| 478 | 478 | |
| 479 | - protected function resolveExprBitwiseNot(Expr\BitwiseNot $node): int|string |
|
| 479 | + protected function resolveExprBitwiseNot(Expr\BitwiseNot $node): int | string |
|
| 480 | 480 | { |
| 481 | 481 | return ~$this->resolve($node->expr); |
| 482 | 482 | } |
@@ -508,7 +508,7 @@ discard block |
||
| 508 | 508 | |
| 509 | 509 | protected function resolveExprBinaryOpConcat(Expr\BinaryOp\Concat $node): string |
| 510 | 510 | { |
| 511 | - return $this->resolve($node->left) . $this->resolve($node->right); |
|
| 511 | + return $this->resolve($node->left).$this->resolve($node->right); |
|
| 512 | 512 | } |
| 513 | 513 | |
| 514 | 514 | protected function resolveExprTernary(Expr\Ternary $node): mixed |
@@ -589,12 +589,12 @@ discard block |
||
| 589 | 589 | return $this->resolve($node->left) xor $this->resolve($node->right); |
| 590 | 590 | } |
| 591 | 591 | |
| 592 | - protected function resolveExprUnaryMinus(Expr\UnaryMinus $node): int|float |
|
| 592 | + protected function resolveExprUnaryMinus(Expr\UnaryMinus $node): int | float |
|
| 593 | 593 | { |
| 594 | 594 | return -$this->resolve($node->expr); |
| 595 | 595 | } |
| 596 | 596 | |
| 597 | - protected function resolveExprUnaryPlus(Expr\UnaryPlus $node): int|float |
|
| 597 | + protected function resolveExprUnaryPlus(Expr\UnaryPlus $node): int | float |
|
| 598 | 598 | { |
| 599 | 599 | return $this->resolve($node->expr); |
| 600 | 600 | } |
@@ -603,7 +603,7 @@ discard block |
||
| 603 | 603 | { |
| 604 | 604 | $nodeType = $node->getType(); |
| 605 | 605 | |
| 606 | - return 'resolve' . str_replace('_', '', $nodeType); |
|
| 606 | + return 'resolve'.str_replace('_', '', $nodeType); |
|
| 607 | 607 | } |
| 608 | 608 | |
| 609 | 609 | /** |