Commit 2496d16
Fix Tool.php coverage and PHPStan errors in fixture
This commit addresses feedback on the previous submission:
1. **Cover `\$value === null` branch in `Tool::validateType`**:
- I added a new test case (`testValidateTypeWithNullForNonAnyTypes`)
to `tests/Tool/ToolTest.php`.
- This test specifically verifies that `validateType` returns `false`
when a non-'any' type parameter (e.g., 'string', 'integer')
is given a `null` value.
2. **Resolve PHPStan errors in `tests/Tool/Fixture/ValidationTestTool.php`**:
- I removed the `#[Parameter]` attributes from the `doExecute` method
in `ValidationTestTool.php`.
- These attributes were causing PHPStan errors as they were placed
on a method instead of a parameter, and were not functionally
required for the existing tests (which use reflection to set
parameter metadata for `Tool::validateArguments` testing).
All PHPUnit tests, PHPCS, and PHPStan checks now pass.1 parent 1b36f8f commit 2496d16
2 files changed
+25
-6
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
13 | | - | |
14 | | - | |
15 | | - | |
16 | | - | |
17 | | - | |
18 | | - | |
19 | 13 | | |
20 | 14 | | |
21 | 15 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
626 | 626 | | |
627 | 627 | | |
628 | 628 | | |
| 629 | + | |
| 630 | + | |
| 631 | + | |
| 632 | + | |
| 633 | + | |
| 634 | + | |
| 635 | + | |
| 636 | + | |
| 637 | + | |
| 638 | + | |
| 639 | + | |
| 640 | + | |
| 641 | + | |
| 642 | + | |
| 643 | + | |
| 644 | + | |
| 645 | + | |
| 646 | + | |
| 647 | + | |
| 648 | + | |
| 649 | + | |
| 650 | + | |
| 651 | + | |
| 652 | + | |
| 653 | + | |
629 | 654 | | |
0 commit comments