You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Improving the MethodMustReturnType to support unions (#7)
* Improving the MethodMustReturnType rule
* Fixing edge cases
* Add regex support for method return type validation
- Introduced new classes for testing regex patterns in method return types.
- Enhanced the MethodMustReturnTypeRule to support regex matching for expected return types.
- Updated documentation to reflect regex usage in return type rules.
- Added comprehensive tests for various valid and invalid cases involving regex patterns.
---------
Co-authored-by: Florian Krämer <[email protected]>
@@ -104,6 +110,7 @@ Ensures that classes inside namespaces matching a given regex must have names ma
104
110
Ensures that specific exception types are not caught in catch blocks. This is useful for preventing the catching of overly broad exception types like `Exception`, `Error`, or `Throwable`.
@@ -118,6 +125,7 @@ Ensures that specific exception types are not caught in catch blocks. This is us
118
125
Ensures that methods returning boolean values follow a specific naming convention. By default, boolean methods should start with `is`, `has`, `can`, `should`, `was`, or `will`.
## Method Must Return Type Rule {#method-must-return-type-rule}
160
170
161
-
Ensures that methods matching a class and method name pattern have a specific return type, nullability, or are void.
171
+
Ensures that methods matching a class and method name pattern have a specific return type, nullability, or are void. Supports union types with "oneOf" and "allOf" configurations.
0 commit comments