phpstan/phpstan-phpunit
PHPStan extension for PHPUnit: improves type inference for mocks (intersection types for createMock/getMock), understands Foo|MockObject phpDocs, adds early-terminating methods to avoid undefined vars, and refines assert() types. Optional strict rules catch improper assertion usage.
|
Package
|
Score
|
Description
|
Stars
|
Likes
|
Forks
|
Downloads
|
Issues
|
Score
|
Opportunity
|
License
|
Last Release
|
|
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| shipmonk/phpstan-dev | 0.89 | Utilities for developing PHPStan rules: write expected errors directly in fixture files using // error: comments and avoid brittle line-number assertions. Includes an autofix mode to generate/update inline error comments during rule development. | 7 | 7 | 1 | 6K | 1 | 13.5 | 43.7 | MIT | 5 months ago | |
| voku/phpstan-rules | 0.88 | Additional PHPStan rules to catch risky and redundant condition logic and comparisons. Detects double negatives, PHP 8 behavior changes (0 vs ''), insane/invalid comparisons (0=='0foo', 0==='0'), and type-mismatch checks (e.g., object vs non-object). | 33 | 33 | 1 | 3K | 1 | 0.4 | 26.6 | MIT | — | |
| phpstan/phpstan-mockery | 0.87 | PHPStan extension for Mockery: infers intersection types for mocks (Foo&MockInterface), understands shouldReceive/shouldHaveReceived/allows/expects, supports partial/alias/overload mocks, multiple interfaces, and proper constructor args for accurate static analysis. | 103 | 103 | 24 | 1M | 9 | 9.8 | 58.4 | MIT | 1 year ago | |
| phpstan/phpstan-webmozart-assert | 0.87 | PHPStan extension for webmozart/assert that teaches PHPStan how Assert::* calls narrow types. Supports many assertions (including nullOr*/all*) so values become non-null, specific scalars, instances, arrays, etc. after validation, improving static analysis accuracy. | 184 | 184 | 32 | 647K | 6 | 12.8 | 51.3 | MIT | 1 year ago | |
| thecodingmachine/phpstan-safe-rule | 0.85 | PHPStan rule set that flags calls to “unsafe” PHP functions that can return false on failure and suggests using the thecodingmachine/safe equivalents that throw exceptions, helping enforce safer, exception-based error handling in your codebase. | 62 | 62 | 25 | 234K | 3 | 26.2 | 57.7 | — | 4 weeks ago | |
| phpstan/phpstan-beberlei-assert | 0.84 | PHPStan extension for beberlei/assert. Adds improved static analysis and type inference for Assert::that and related assertions, helping PHPStan understand refined types after checks and reducing false positives in codebases using beberlei/assert. | 43 | 44 | 16 | 107K | 4 | 11.3 | 50.0 | MIT | 9 months ago |
How can I help you explore Laravel packages today?