-
Notifications
You must be signed in to change notification settings - Fork 70
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Ignore throws in function mocks (#245)
# Summary <!-- Required --> I have noticed that in some circumstances the mocks contained in `API/function-mocks.php` could trigger false positives in static analyzers like PhpStan or just the IDE if using WP_Mock within a project. I think by removing the `@throws` solves this, although PhpStan will complain about it _in this_ project. I suppose since these are just internal mocks we can safely ignore. I did try using `@noinspection` tags but PhpStorm wasn't happy (whether specific to unhandled exceptions or not). As for the strict type notations, same reason, externally it will reflect WP behavior (the alternative was to leave non-strict and rely only on phpdoc -- like WP does -- but then PhpStan would complain again... could swap that for a phpstan-ignore again, up to you) ## Closes #248 ## Contributor checklist <!-- Required --> <!--- Go over all the following points, and put an `x` in all the boxes that apply. --> <!--- If you are unsure about any of these, please ask for clarification. We are here to help! --> - [x] I agree to follow this project's [**Code of Conduct**](https://github.com/10up/.github/blob/trunk/CODE_OF_CONDUCT.md). - [x] I have updated the documentation accordingly - [x] I have added tests to cover changes introduced by this pull request - [x] All new and existing tests pass ## Testing <!-- Required --> <!-- If applicable, add specific steps for the reviewer to perform as part of their testing process prior to approving this pull request. --> <!-- List any configuration requirements for testing. --> ### Reviewer checklist <!-- Required --> <!-- The following checklist is for the reviewer: add any steps that may be relevant while reviewing this pull request --> - [x] Code changes review - [ ] Documentation changes review - [x] Unit tests pass - [x] Static analysis passes
- Loading branch information
Showing
3 changed files
with
52 additions
and
50 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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