Ternary number compare to max() call
class SomeClass
{
public function run($value)
{
- return $value > 100 ? $value : 100;
+ return max($value, 100);
}
}
Configure your rector.php
:
<?php
use Rector\CodeQuality\Rector\Ternary\NumberCompareToMaxFuncCallRector;
use Rector\Config\RectorConfig;
return RectorConfig::configure()
->withRules([
NumberCompareToMaxFuncCallRector::class,
]);