Change settype() to (type) on standalone line. settype() returns always success/failure bool value
class SomeClass
{
public function run($foo)
{
- settype($foo, 'string');
+ $foo = (string) $foo;
}
}
Configure your rector.php:
<?php
use Rector\CodeQuality\Rector\FuncCall\SetTypeToCastRector;
use Rector\Config\RectorConfig;
return RectorConfig::configure()
->withRules([
SetTypeToCastRector::class,
]);