Releases: boundwize/structarmed
Release list
Released: StructArmed 0.14.6
What's Changed
- [perf] Re-use instanceof FixableInterface on Analyser by @samsonasik in #187
- Fix baseline generation after applying --fix by @samsonasik in #188
Full Changelog: 0.14.5...0.14.6
Released: StructArmed 0.14.5
What's Changed
- chore: make consistent use of node for JsonRecast usage by @samsonasik in #186
Full Changelog: 0.14.4...0.14.5
Released: StructArmed 0.14.4
What's Changed
- Make use of JsonRecast to make Psr4DirectoryExistsRule fixable by @samsonasik in #185
Full Changelog: 0.14.3...0.14.4
Released: StructArmed 0.14.3
What's Changed
- chore: use ClassConst sub namespace on AddPublicConstantVisibilityVisitor by @samsonasik in #184
Full Changelog: 0.14.2...0.14.3
Released: StructArmed 0.14.2
What's Changed
- chore: Extract
Psr1Utf8WithoutBomRuleinto 2 rules:Psr1Utf8WithoutBomRuleandPsr1ValidUtf8Ruleand makePsr1Utf8WithoutBomRuleimplementsFixableInterfaceby @samsonasik in #183
Full Changelog: 0.14.1...0.14.2
Released: StructArmed 0.14.1
What's Changed
- docs: add implements FixableInterface example by @samsonasik in #180
- Make Psr1PhpTagsRule implements FixableInterface by @samsonasik in #181
- chore: move namespace ClassProperty to Property by @samsonasik in #182
Full Changelog: 0.14.0...0.14.1
Released: StructArmed 0.14.0
StructArmed 0.14.0 introduces new Boundwize\StructArmed\Rule\FixableInterface that when rule implements it, it can apply a fix with make use of fix method, eg:
use Boundwize\StructArmed\Rule\FixableInterface;
-final readonly class SomeRule implements RuleInterface
+final readonly class SomeRule implements RuleInterface, FixableInterface
{
+ public function fix(RuleViolation $ruleViolation): bool
+ {
+ // do custom fix implementation based on RuleViolation object information
+ }
}This feature brings some example of it that utilize PhpParser:
- MustDeclareConstantVisibilityRule
- MustDeclareMethodVisibilityRule
- MustDeclarePropertyVisibilityRule
that extends Boundwize\StructArmed\Rule\Fixer\PhpParser\AbstractPhpParserFixableRule that we only need to define the PhpParser visitor that do the fix:
protected function createFixerVisitor(RuleViolation $ruleViolation): AddPublicConstantVisibilityVisitor
{
/** @var string $constantName */
$constantName = $ruleViolation->constantName;
return new AddPublicConstantVisibilityVisitor(
$ruleViolation->className,
$constantName
);
}The usage will be:
vendor/bin/structarmed analyze --fix
The example usage will be on https://boundwize.github.io/structarmed/custom-rules-and-presets/
What's Changed
- Add FixableInterface to allow --fix on rule that implements it by @samsonasik in #179
Full Changelog: 0.13.8...0.14.0
Released: StructArmed 0.13.8
What's Changed
- [perf] Optimize layer-aware rules using shared ClassNode index by @samsonasik in #178
Full Changelog: 0.13.7...0.13.8
Released: StructArmed 0.13.7
What's Changed
- Consistent path normalize/resolving accross platforms by @samsonasik in #176
Full Changelog: 0.13.6...0.13.7
Released: StructArmed 0.13.6
What's Changed
- Move FileAnalysisRuleInterface to under Rule by @samsonasik in #174
Full Changelog: 0.13.5...0.13.6