mirror of
https://github.com/rectorphp/rector.git
synced 2024-06-20 18:12:24 +00:00
[Php71] Skip magic const __LINE__ on BinaryOpBetweenNumberAndStringRector (#200)
This commit is contained in:
parent
8675bcb12a
commit
932458fd09
|
@ -0,0 +1,12 @@
|
|||
<?php
|
||||
|
||||
namespace Rector\Tests\Php71\Rector\BinaryOp\BinaryOpBetweenNumberAndStringRector\Fixture;
|
||||
|
||||
class SkipMagicConstLine
|
||||
{
|
||||
public function run()
|
||||
{
|
||||
$value = __LINE__ - 1;
|
||||
$value = 1 - __LINE__;
|
||||
}
|
||||
}
|
|
@ -12,6 +12,7 @@ use PhpParser\Node\Expr\BinaryOp\Concat;
|
|||
use PhpParser\Node\Expr\Variable;
|
||||
use PhpParser\Node\Scalar;
|
||||
use PhpParser\Node\Scalar\LNumber;
|
||||
use PhpParser\Node\Scalar\MagicConst\Line;
|
||||
use PhpParser\Node\Scalar\String_;
|
||||
use PHPStan\Type\Constant\ConstantStringType;
|
||||
use Rector\Core\Rector\AbstractRector;
|
||||
|
@ -102,6 +103,10 @@ CODE_SAMPLE
|
|||
return false;
|
||||
}
|
||||
|
||||
if ($expr instanceof Line) {
|
||||
return false;
|
||||
}
|
||||
|
||||
$value = null;
|
||||
$exprStaticType = $this->getStaticType($expr);
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user