exactCompareFactory = $exactCompareFactory;
}
public function getRuleDefinition() : RuleDefinition
{
$errorMessage = \sprintf('Fixer for PHPStan reports by strict type rule - "%s"', 'PHPStan\\Rules\\BooleansInConditions\\BooleanInTernaryOperatorRule');
return new RuleDefinition($errorMessage, [new ConfiguredCodeSample(<<<'CODE_SAMPLE'
final class ArrayCompare
{
public function run(array $data)
{
return $data ? 1 : 2;
}
}
CODE_SAMPLE
, <<<'CODE_SAMPLE'
final class ArrayCompare
{
public function run(array $data)
{
return $data !== [] ? 1 : 2;
}
}
CODE_SAMPLE
, [self::TREAT_AS_NON_EMPTY => \false])]);
}
/**
* @return array