Skip to content

Commit f76cccd

Browse files
committed
remove custom printer pScalar_Int as no longer needed
1 parent 3a3ecce commit f76cccd

1 file changed

Lines changed: 0 additions & 32 deletions

File tree

src/PhpParser/Printer/BetterStandardPrinter.php

Lines changed: 0 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,6 @@
2323
use PhpParser\Node\Expr\Ternary;
2424
use PhpParser\Node\Expr\Yield_;
2525
use PhpParser\Node\InterpolatedStringPart;
26-
use PhpParser\Node\Scalar\Float_;
27-
use PhpParser\Node\Scalar\Int_;
2826
use PhpParser\Node\Scalar\InterpolatedString;
2927
use PhpParser\Node\Scalar\String_;
3028
use PhpParser\Node\Stmt\Declare_;
@@ -297,18 +295,6 @@ protected function pArray(
297295
return Strings::replace($content, self::EXTRA_SPACE_BEFORE_NOP_REGEX);
298296
}
299297

300-
/**
301-
* Emulates 1_000 in PHP 7.3- version
302-
*/
303-
protected function pScalar_Float(Float_ $float): string
304-
{
305-
if ($this->shouldPrintNewRawValue($float)) {
306-
return (string) $float->getAttribute(AttributeKey::RAW_VALUE);
307-
}
308-
309-
return parent::pScalar_Float($float);
310-
}
311-
312298
/**
313299
* Do not add "()" on Expressions
314300
* @see https://github.com/rectorphp/rector/pull/401#discussion_r181487199
@@ -405,19 +391,6 @@ protected function pScalar_InterpolatedString(InterpolatedString $interpolatedSt
405391
return $content;
406392
}
407393

408-
/**
409-
* Invoke re-print even if only raw value was changed.
410-
* That allows PHPStan to use int strict types, while changing the value with literal "_"
411-
*/
412-
protected function pScalar_Int(Int_ $int): string
413-
{
414-
if ($this->shouldPrintNewRawValue($int)) {
415-
return (string) $int->getAttribute(AttributeKey::RAW_VALUE);
416-
}
417-
418-
return parent::pScalar_Int($int);
419-
}
420-
421394
protected function pExpr_MethodCall(MethodCall $methodCall): string
422395
{
423396
if (! $methodCall->var instanceof CallLike) {
@@ -568,11 +541,6 @@ private function getIndentCharacter(): string
568541
return SimpleParameterProvider::provideStringParameter(Option::INDENT_CHAR, ' ');
569542
}
570543

571-
private function shouldPrintNewRawValue(Int_|Float_ $lNumber): bool
572-
{
573-
return $lNumber->getAttribute(AttributeKey::REPRINT_RAW_VALUE) === true;
574-
}
575-
576544
/**
577545
* @param Node[] $stmts
578546
* @return Node[]|mixed[]

0 commit comments

Comments
 (0)