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