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
Copy file name to clipboardExpand all lines: docs/rules/Method-Signature-Must-Match-Rule.md
+28-1Lines changed: 28 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,6 @@
1
1
# Method Signature Must Match Rule
2
2
3
-
Ensures that methods matching a class and method name pattern have a specific signature, including parameter types, names, and count.
3
+
Ensures that methods matching a class and method name pattern have a specific signature, including parameter types, names, and count. Optionally enforces that matching classes must implement the specified method.
4
4
5
5
## Configuration Example
6
6
@@ -30,4 +30,31 @@ Ensures that methods matching a class and method name pattern have a specific si
30
30
-`minParameters`/`maxParameters`: Minimum/maximum number of parameters.
31
31
-`signature`: List of expected parameter types and (optionally) name patterns.
-`required`: Optional boolean (default: `false`). When `true`, enforces that any class matching the pattern must implement the method with the specified signature.
33
34
35
+
## Required Methods
36
+
37
+
When the `required` parameter is set to `true`, the rule will check if classes matching the pattern actually implement the specified method. If a matching class is missing the method, an error will be reported with details about the expected signature.
In this example, any class ending with "Controller" must implement a public `execute` method that takes exactly one parameter of type `Request` named `request`.
0 commit comments