Repository navigation
PHPStan Rules 14.16
Rule sets are now toggleable from a single symplify parameter, 4 too-narrow Symfony rules are gone, and a batch of false positives is fixed across Symfony, Doctrine, PHPUnit and the ctor rules.
New features 🎉
Toggle whole rule sets on/off
Naming, complexity, configurable and static sets are now auto-loaded via phpstan/extension-installer and gated by a parameter - all on by default, so no behavior change on upgrade (#301, #304):
parameters:
symplify:
naming: false
complexity: false
configurable: false
static: falseRequireExceptionNamespaceRule, RequireAttributeNamespaceRule and CheckRequiredInterfaceInContractNamespaceRule moved from static-rules.neon to naming-rules.neon.
naming-rules.neon is auto-loaded now - drop its manual include from your phpstan.neon to avoid double registration.
Bugfixes 🐛
- [symfony] Make
NoFindTaggedServiceIdsCallRulecontext-aware - skip when foreach reads tag attributes, e.g.$tags[0]['alias'](#317) - [symfony] Skip
NoFindTaggedServiceIdsCallRulein test classes (#309) - [symfony] Allow 2nd dynamic arg in
SingleArgEventDispatchRule(#310) - [doctrine] Skip
#[AsDoctrineListener]attribute inNoDoctrineListenerWithoutContractRule(#318) - [doctrine] Scope
RequireQueryBuilderOnRepositoryRuleto repository classes only (#306) - [doctrine] Skip unconvertible builders in
RequireQueryBuilderOnRepositoryRule(#312) - [doctrine] Suggest fetching repository from test container in test classes (#305)
- [phpunit] Skip variable-callable in
NoAssertFuncCallInTestsRule(#311) - [ctor]
NewOverSettersRule- skip Doctrine entities with#[ORM\Entity](#307), controllers (#313) and test classes (#314), add regression test for setter in loop (#316) - Fix
NoReferenceRulefalse positive when parent class is not first in its file (#292), thanks @SanderMuller