Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added PHPStan for Static Analysis #40

Merged
merged 4 commits into from
Mar 9, 2023
Merged

Added PHPStan for Static Analysis #40

merged 4 commits into from
Mar 9, 2023

Conversation

n7studios
Copy link
Contributor

Summary

Adds PHPStan for static analysis, covering:

  • Correct variable declarations
  • More accurate typehints in docblocks when specifying or returning arrays
  • Moving InvalidArgumentException checks onto individual if blocks to prevent false positive reports in PHPStan
  • Passing valid variable types to functions such as preg_replace
  • Improved type checking on return values such as json_encode

Testing

Existing tests pass

Checklist

@n7studios n7studios self-assigned this Mar 8, 2023
@n7studios n7studios requested review from a team, noelherrick and corydhmiller and removed request for a team March 8, 2023 14:42
@n7studios n7studios marked this pull request as ready for review March 8, 2023 14:42
@n7studios n7studios merged commit c60e6bf into 1.0-beta Mar 9, 2023
@n7studios n7studios added this to the 1.0.0 milestone Mar 9, 2023
@n7studios n7studios deleted the phpstan branch March 23, 2023 16:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants