Change binary operation between some number + string to PHP 7.1 compatible version
class SomeClass
{
public function run()
{
- $value = 5 + '';
- $value = 5.0 + 'hi';
+ $value = 5 + 0;
+ $value = 5.0 + 0.0;
}
}
Configure your rector.php
:
<?php
use Rector\Config\RectorConfig;
use Rector\Php71\Rector\BinaryOp\BinaryOpBetweenNumberAndStringRector;
return RectorConfig::configure()
->withRules([
BinaryOpBetweenNumberAndStringRector::class,
]);