Skip to content

Commit 4def38d

Browse files
committed
[BE] Check that each trait is used and analysed at least once
1 parent 5cd4572 commit 4def38d

File tree

5 files changed

+6
-13
lines changed

5 files changed

+6
-13
lines changed

changelog-2.0.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ Major new features 🚀
1414
* [Learn more on phpstan.org](https://phpstan.org/blog/enhancements-in-handling-parameters-passed-by-reference)
1515
* [#2941](https://github.com/phpstan/phpstan-src/pull/2941), thanks @ljmaskey!
1616
* LogicalXorConstantConditionRule (level 4) (https://github.com/phpstan/phpstan-src/commit/3a12724fd636b1bcf36c22b36e8f765d97150895, https://github.com/phpstan/phpstan-src/commit/3b011f6524254dad0f16840fdcfdbe7421548617), #7539
17+
* Check that each trait is used and analysed at least once (level 4) (https://github.com/phpstan/phpstan-src/commit/c4d05276fb8605d6ac20acbe1cc5df31cd6c10b0)
1718
* Check preg_quote delimiter sanity (level 0) ([#3252](https://github.com/phpstan/phpstan-src/pull/3252)), #11338, thanks @staabm!
1819
* Added previously absent type checks (level 0)
1920
* Check existing classes in `@phpstan-self-out` (https://github.com/phpstan/phpstan-src/commit/6838669976bf20232abde36ecdd52b1770fa50c9)
@@ -44,7 +45,6 @@ Bleeding edge (TODO move to other sections)
4445
* Unresolvable parameters ([#1319](https://github.com/phpstan/phpstan-src/pull/1319)), thanks @rvanvelzen!
4546
* Support `@readonly` property and `@immutable` class PHPDoc ([#1295](https://github.com/phpstan/phpstan-src/pull/1295), [#1335](https://github.com/phpstan/phpstan-src/pull/1335)), #4082, thanks @herndlm!
4647
* Move IllegalConstructorMethodCallRule and IllegalConstructorStaticCallRule to phpstan-strict-rules (https://github.com/phpstan/phpstan-src/commit/124b30f98c182193187be0b9c2e151e477429b7a, https://github.com/phpstan/phpstan-strict-rules/commit/0c82c96f2a55d8b91bbc7ee6512c94f68a206b43)
47-
* Check that each trait is used and analysed at least once - level 4 (https://github.com/phpstan/phpstan-src/commit/c4d05276fb8605d6ac20acbe1cc5df31cd6c10b0)
4848
* Check that PHPStan class in class constant fetch is covered by backward compatibility promise (https://github.com/phpstan/phpstan-src/commit/9e007251ce61788f6a0319a53f1de6cf801ed233)
4949
* Check code in custom PHPStan extensions for runtime reflection concepts like `is_a()` or `class_parents()` (https://github.com/phpstan/phpstan-src/commit/c4a662ac6c3ec63f063238880b243b5399c34fcc)
5050
* Check code in custom PHPStan extensions for runtime reflection concepts like `new ReflectionMethod()` (https://github.com/phpstan/phpstan-src/commit/536306611cbb5877b6565755cd07b87f9ccfdf08)

conf/bleedingEdge.neon

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ parameters:
1414
checkUnresolvableParameterTypes: true
1515
readOnlyByPhpDoc: true
1616
runtimeReflectionRules: true
17-
notAnalysedTrait: true
1817
curlSetOptTypes: true
1918
missingMagicSerializationRule: true
2019
nullContextForVoidReturningFunctions: true

conf/config.level4.neon

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -17,16 +17,11 @@ rules:
1717
- PHPStan\Rules\TooWideTypehints\TooWideFunctionReturnTypehintRule
1818
- PHPStan\Rules\TooWideTypehints\TooWideFunctionParameterOutTypeRule
1919
- PHPStan\Rules\TooWideTypehints\TooWideMethodParameterOutTypeRule
20+
- PHPStan\Rules\Traits\NotAnalysedTraitRule
2021

2122
conditionalTags:
2223
PHPStan\Rules\Comparison\ConstantLooseComparisonRule:
2324
phpstan.rules.rule: %featureToggles.looseComparison%
24-
PHPStan\Rules\Traits\TraitDeclarationCollector:
25-
phpstan.collector: %featureToggles.notAnalysedTrait%
26-
PHPStan\Rules\Traits\TraitUseCollector:
27-
phpstan.collector: %featureToggles.notAnalysedTrait%
28-
PHPStan\Rules\Traits\NotAnalysedTraitRule:
29-
phpstan.rules.rule: %featureToggles.notAnalysedTrait%
3025
PHPStan\Rules\DeadCode\CallToConstructorStatementWithoutImpurePointsRule:
3126
phpstan.rules.rule: %featureToggles.pure%
3227
PHPStan\Rules\DeadCode\PossiblyPureNewCollector:
@@ -299,12 +294,13 @@ services:
299294

300295
-
301296
class: PHPStan\Rules\Traits\TraitDeclarationCollector
297+
tags:
298+
- phpstan.collector
302299

303300
-
304301
class: PHPStan\Rules\Traits\TraitUseCollector
305-
306-
-
307-
class: PHPStan\Rules\Traits\NotAnalysedTraitRule
302+
tags:
303+
- phpstan.collector
308304

309305
-
310306
class: PHPStan\Rules\Exceptions\CatchWithUnthrownExceptionRule

conf/config.neon

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@ parameters:
3535
checkUnresolvableParameterTypes: false
3636
readOnlyByPhpDoc: false
3737
runtimeReflectionRules: false
38-
notAnalysedTrait: false
3938
curlSetOptTypes: false
4039
missingMagicSerializationRule: false
4140
nullContextForVoidReturningFunctions: false

conf/parametersSchema.neon

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,6 @@ parametersSchema:
4141
checkUnresolvableParameterTypes: bool()
4242
readOnlyByPhpDoc: bool()
4343
runtimeReflectionRules: bool()
44-
notAnalysedTrait: bool()
4544
curlSetOptTypes: bool()
4645
missingMagicSerializationRule: bool()
4746
nullContextForVoidReturningFunctions: bool()

0 commit comments

Comments
 (0)