Skip to content

Commit 93e0259

Browse files
authored
[automated] Apply Coding Standard (#5782)
Co-authored-by: TomasVotruba <924196+TomasVotruba@users.noreply.github.com>
1 parent aa706a1 commit 93e0259

3 files changed

Lines changed: 15 additions & 11 deletions

File tree

config/set/php82.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@
44

55
use Rector\Config\RectorConfig;
66
use Rector\Php82\Rector\Class_\ReadOnlyClassRector;
7+
use Rector\Php82\Rector\Encapsed\VariableInStringInterpolationFixerRector;
78
use Rector\Php82\Rector\FuncCall\Utf8DecodeEncodeToMbConvertEncodingRector;
89
use Rector\Php82\Rector\New_\FilesystemIteratorSkipDotsRector;
9-
use Rector\Php82\Rector\Encapsed\VariableInStringInterpolationFixerRector;
1010

1111
return static function (RectorConfig $rectorConfig): void {
1212
$rectorConfig->rules([

rules/Php82/Rector/Encapsed/VariableInStringInterpolationFixerRector.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ public function refactor(Node $node): ?Node
6262

6363
$startTokenPos = $part->getStartTokenPos();
6464

65-
if (! isset($oldTokens[$startTokenPos]) ) {
65+
if (! isset($oldTokens[$startTokenPos])) {
6666
continue;
6767
}
6868

src/PhpParser/Printer/BetterStandardPrinter.php

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -459,14 +459,6 @@ protected function pScalar_LNumber(LNumber $lNumber): string|int
459459
return parent::pScalar_LNumber($lNumber);
460460
}
461461

462-
private function resolveIndentSpaces(): string
463-
{
464-
$indentSize = SimpleParameterProvider::provideIntParameter(Option::INDENT_SIZE);
465-
466-
return str_repeat($this->getIndentCharacter(), $this->indentLevel) .
467-
str_repeat($this->getIndentCharacter(), $indentSize);
468-
}
469-
470462
protected function pExpr_MethodCall(MethodCall $methodCall): string
471463
{
472464
if (SimpleParameterProvider::provideBoolParameter(Option::NEW_LINE_ON_FLUENT_CALL) === false) {
@@ -482,7 +474,11 @@ protected function pExpr_MethodCall(MethodCall $methodCall): string
482474
$arg->value->setAttribute(AttributeKey::ORIGINAL_NODE, null);
483475
}
484476

485-
return $this->pDereferenceLhs($methodCall->var) . "\n" . $this->resolveIndentSpaces() . "->" . $this->pObjectProperty($methodCall->name)
477+
return $this->pDereferenceLhs(
478+
$methodCall->var
479+
) . "\n" . $this->resolveIndentSpaces() . '->' . $this->pObjectProperty(
480+
$methodCall->name
481+
)
486482
. '(' . $this->pMaybeMultiline($methodCall->args) . ')';
487483
}
488484

@@ -503,6 +499,14 @@ protected function pParam(Param $param): string
503499
. ($param->default instanceof Expr ? ' = ' . $this->p($param->default) : '');
504500
}
505501

502+
private function resolveIndentSpaces(): string
503+
{
504+
$indentSize = SimpleParameterProvider::provideIntParameter(Option::INDENT_SIZE);
505+
506+
return str_repeat($this->getIndentCharacter(), $this->indentLevel) .
507+
str_repeat($this->getIndentCharacter(), $indentSize);
508+
}
509+
506510
/**
507511
* Must be a method to be able to react to changed parameter in tests
508512
*/

0 commit comments

Comments
 (0)