Repository navigation
Update dependency boundwize/structarmed to ^0.21.0 - #580
Merged
Merged
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## 7.0 #580 +/- ##
=========================================
Coverage 64.64% 64.64%
Complexity 1003 1003
=========================================
Files 181 181
Lines 3437 3437
=========================================
Hits 2222 2222
Misses 1215 1215 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
alexmerlin
approved these changes
Nov 7, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR contains the following updates:
^0.20.0→^0.21.0Release Notes
boundwize/structarmed
v0.21.4: Released: StructArmed 0.21.4Compare Source
What's Changed
Full Changelog: boundwize/structarmed@0.21.3...0.21.4
v0.21.3: Released: StructArmed 0.21.3Compare Source
What's Changed
Full Changelog: boundwize/structarmed@0.21.2...0.21.3
v0.21.2: Released: StructArmed 0.21.2Compare Source
What's Changed
Full Changelog: boundwize/structarmed@0.21.1...0.21.2
v0.21.1: Released: StructArmed 0.21.1Compare Source
What's Changed
Full Changelog: boundwize/structarmed@0.21.0...0.21.1
v0.21.0: Released: StructArmed 0.21.0Compare Source
StructArmed 0.21.0 introduces a new Enum preset, stronger API stability checks, signature type analysis for custom rules, and improved enum formatting support.
This release introduces:
Preset::ENUM()for validating string-backed enum case values;ApiMayNotExposeInternalRulefor preventing public APIs from exposing internal types;ClassSignatureandSignatureTypesAwareRuleInterfacefor analyzing member signature types;EnumCaseMustBeOnOwnLineRulein the PER preset;New Enum Preset
StructArmed introduces a new preset for validating string-backed enum case values:
The preset includes two new rules:
EnumCaseValueMustNotBeEmptyRule— prevents empty string-backed enum values.EnumCaseValueMustNotHaveSurroundingWhitespaceRule— prevents leading or trailing whitespace in string-backed enum values.For example:
The first two cases produce violations, while
Completedis valid.The rules check statically resolved string-backed values. Pure enums and integer-backed enums are unaffected.
These rules do not support
--fix, as changing backing values could break existing APIs or persisted data.Enable the preset with:
Or initialize a new configuration:
API Stability Improvements
The Stability preset now includes
ApiMayNotExposeInternalRule, preventing@apideclarations from exposing@internaltypes through public or protected signatures.For example:
The rule reports an architecture violation because the public method exposes an internal implementation.
The rule checks:
Private implementation details remain unrestricted, except when exposed through a public or protected constructor parameter.
Only types within the scanned project are checked, since external declarations may not have available PHPDoc information.
New Signature Type Analysis
StructArmed introduces
ClassSignatureandSignatureTypesAwareRuleInterfacefor analyzing types referenced in class-like member signatures.Each
ClassSignatureprovides:type— fully qualified referenced type;name— originating property, parameter, or method;kind— property, parameter, or method;visibility— public, protected, or private;line— source line.Custom rules can implement
SignatureTypesAwareRuleInterfaceto access signature information through$classNode->signatures.Custom Rule Example
For example, prevent public repository methods from returning Doctrine's
QueryBuilder:With this rule, the following method produces a violation:
This allows repositories to use
QueryBuilderinternally without exposing it through their public APIs.Signature collection is enabled only when an active rule implements
SignatureTypesAwareRuleInterface, avoiding unnecessary analysis overhead and cache storage.The collector supports nullable, union, intersection, and DNF types, including constructor-promoted properties.
PER Coding Style Improvements
The PER preset now includes
EnumCaseMustBeOnOwnLineRule, requiring each enum case to be declared on its own line.For example:
The rule supports automatic fixing:
Result:
The fixer preserves associated comments when moving enum cases, including comments on shared lines.
Bug Fixes and Internal Improvements
EnumCaseNode::sharesLinefor detecting enum cases that share a line with another member or enum brace.What's Changed
ClassSignaturesupport in #524 and #526.Full Changelog: boundwize/structarmed@0.20.5...0.21.0
Configuration
📅 Schedule: (UTC)
🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.
♻ Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.
🔕 Ignore: Close this PR and you won't be reminded about this update again.
This PR was generated by Mend Renovate. View the repository job log.