| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Name | Name | Last commit date | ||
|---|---|---|---|---|
Custom Infection mutation testing mutators for PHPStan's codebase. These mutators target PHPStan-specific patterns (TrinaryLogic, type comparisons, type specifier contexts) that generic Infection mutators would not cover.
Used as a build dependency by PHPStan repositories (phpstan-src, phpstan-doctrine, phpstan-phpunit, phpstan-deprecation-rules, etc.).
Swaps ->yes() with !->no() and vice versa, including the inverse (!->yes() to ->no()). Tests that TrinaryLogic checks are precise and not interchangeable.
- $type->isBoolean()->yes();
+ !$type->isBoolean()->no();Inserts ->toBoolean() before ->isTrue()/->isFalse() calls. Tests that code distinguishes strict boolean type checks from loose boolean comparisons. Skips calls that already chain through ->toBoolean().
- $type->isFalse()->yes();
+ $type->toBoolean()->isFalse()->yes();Swaps the callee and argument of isSuperTypeOf() calls. Tests that the direction of type relationships matters. Supports variables, property fetches, method calls, static calls, and new expressions as both callee and argument.
- $a->isSuperTypeOf($b);
+ $b->isSuperTypeOf($a);Swaps isNonFalseyString() with isNonEmptyString() and vice versa. Tests that code correctly distinguishes between non-falsey strings (excludes "0") and non-empty strings (includes "0").
Note: This mutator is not included in the default config. Consuming repos must add it explicitly via --mutator-class='PHPStan\Infection\NonFalseyNonEmptyStringMutator'.
- $type->isNonFalseyString()->yes();
+ $type->isNonEmptyString()->yes();Swaps true() with truthy() and false() with falsey() on TypeSpecifierContext (and vice versa). Tests that code correctly handles strict vs loose type specifier contexts.
- $context->false()
+ $context->falsey()php build-infection/bin/infection-config.php > infection.json5Requires PHP ^8.2.
composer install
make check # lint, coding standard, tests, PHPStan
make tests # PHPUnit (unit + .phpt end-to-end tests)
make phpstan # static analysis (level 8)MIT
| Back | FazBrowse Home | New Git URL |