Changes in_array() with single element to ===
class SomeClass
{
public function run()
{
- if (in_array(strtolower($type), ['$this'], true)) {
+ if (strtolower($type) === '$this') {
return strtolower($type);
}
}
}
Configure your rector.php
:
<?php
use Rector\CodeQuality\Rector\FuncCall\SingleInArrayToCompareRector;
use Rector\Config\RectorConfig;
return RectorConfig::configure()
->withRules([
SingleInArrayToCompareRector::class,
]);