Simplify bool value compare to true or false
class SomeClass
{
public function run(bool $value, string $items)
{
- $match = in_array($value, $items, TRUE) === TRUE;
+ $match = in_array($value, $items, TRUE);
- $match = in_array($value, $items, TRUE) !== FALSE;
+ $match = in_array($value, $items, TRUE);
}
}
Configure your rector.php
:
<?php
use Rector\CodeQuality\Rector\Identical\SimplifyBoolIdenticalTrueRector;
use Rector\Config\RectorConfig;
return RectorConfig::configure()
->withRules([
SimplifyBoolIdenticalTrueRector::class,
]);