staticGuard = $staticGuard;
}
public function getRuleDefinition() : RuleDefinition
{
return new RuleDefinition('Changes Closure to be static when possible', [new CodeSample(<<<'CODE_SAMPLE'
function () {
if (rand(0, 1)) {
return 1;
}
return 2;
}
CODE_SAMPLE
, <<<'CODE_SAMPLE'
static function () {
if (rand(0, 1)) {
return 1;
}
return 2;
}
CODE_SAMPLE
)]);
}
/**
* @return array