Skip to content

Commit c2dc5c4

Browse files
Add new test methods to TestClass for various parameter types and update documentation
- Introduced `testMethodNoType` with mixed parameter types. - Added `testMethodWithWrongType` to validate error handling for incorrect parameter types. - Updated documentation in `MethodMustReturnTypeRule` to clarify checks performed on method signatures.
1 parent 23053d4 commit c2dc5c4

File tree

3 files changed

+10
-1
lines changed

3 files changed

+10
-1
lines changed

data/MethodSignatureMustMatch/TestClass.php

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,12 @@ class TestClass
55
public function testMethod(int $a)
66
{
77
}
8+
9+
public function testMethodNoType($x, string $y)
10+
{
11+
}
12+
13+
public function testMethodWithWrongType(int $x, int $y)
14+
{
15+
}
816
}

src/Architecture/MethodMustReturnTypeRule.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515

1616
/**
1717
* Specification:
18+
*
1819
* - Checks if the classname plus method name matches a given regex pattern.
1920
* - Checks if the method returns the expected type or object, is nullable or void.
2021
* - Check if the types of the parameters match the expected types.

tests/TestCases/Architecture/MethodSignatureMustMatchRuleTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ public function testRule(): void
7070
// - Second parameter has correct type (string) and name matches pattern
7171
// - Parameter count is within limits (1-2)
7272
// - Visibility is correct (public)
73-
73+
7474
// Error for testMethodWithWrongType:
7575
// - First parameter has wrong type (int instead of string)
7676
// - Second parameter has no type specified, so type checking is skipped

0 commit comments

Comments
 (0)