mirror of
https://github.com/rectorphp/rector.git
synced 2025-02-22 02:36:52 +01:00
fix enscaped type resolution
This commit is contained in:
parent
7f453d2d6f
commit
d4c8fbd88f
@ -7,12 +7,14 @@ namespace Rector\NodeTypeResolver\PerNodeTypeResolver;
|
||||
use PhpParser\Node;
|
||||
use PhpParser\Node\Scalar;
|
||||
use PhpParser\Node\Scalar\DNumber;
|
||||
use PhpParser\Node\Scalar\Encapsed;
|
||||
use PhpParser\Node\Scalar\LNumber;
|
||||
use PhpParser\Node\Scalar\MagicConst;
|
||||
use PhpParser\Node\Scalar\String_;
|
||||
use PHPStan\Type\Constant\ConstantFloatType;
|
||||
use PHPStan\Type\Constant\ConstantIntegerType;
|
||||
use PHPStan\Type\Constant\ConstantStringType;
|
||||
use PHPStan\Type\MixedType;
|
||||
use PHPStan\Type\Type;
|
||||
use Rector\Core\Exception\NotImplementedException;
|
||||
use Rector\NodeTypeResolver\Contract\PerNodeTypeResolver\PerNodeTypeResolverInterface;
|
||||
@ -42,6 +44,10 @@ final class ScalarTypeResolver implements PerNodeTypeResolverInterface
|
||||
return new ConstantStringType($node->getName());
|
||||
}
|
||||
|
||||
if ($node instanceof Encapsed) {
|
||||
return new MixedType();
|
||||
}
|
||||
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
}
|
||||
|
@ -0,0 +1,14 @@
|
||||
<?php
|
||||
|
||||
namespace Rector\Php71\Tests\Rector\BinaryOp\BinaryOpBetweenNumberAndStringRector\Fixture;
|
||||
|
||||
class SkipEncapsed
|
||||
{
|
||||
public function run()
|
||||
{
|
||||
// put file content here
|
||||
$a = "test";
|
||||
$b = "that is test";
|
||||
assert($b=="this is $a");
|
||||
}
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user