Skip to content

Commit 879590d

Browse files
committed
[BE] MagicConstantContextRule
1 parent b593dde commit 879590d

File tree

5 files changed

+2
-9
lines changed

5 files changed

+2
-9
lines changed

changelog-2.0.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ Major new features 🚀
1919
* LogicalXorConstantConditionRule (level 4) (https://github.com/phpstan/phpstan-src/commit/3a12724fd636b1bcf36c22b36e8f765d97150895, https://github.com/phpstan/phpstan-src/commit/3b011f6524254dad0f16840fdcfdbe7421548617), #7539
2020
* Check that each trait is used and analysed at least once (level 4) (https://github.com/phpstan/phpstan-src/commit/c4d05276fb8605d6ac20acbe1cc5df31cd6c10b0)
2121
* Check preg_quote delimiter sanity (level 0) ([#3252](https://github.com/phpstan/phpstan-src/pull/3252)), #11338, thanks @staabm!
22+
* MagicConstantContextRule (level 0) ([#2741](https://github.com/phpstan/phpstan-src/pull/2741)), #10099, thanks @staabm!
2223
* Rule for `call_user_func()` (level 5) ([#2479](https://github.com/phpstan/phpstan-src/pull/2479)), thanks @staabm!
2324
* Check array functions which require stringish values (level 5) ([#3132](https://github.com/phpstan/phpstan-src/pull/3132)), #11141, #5848, #3694, #11111, thanks @schlndh!
2425
* Check variance of template types in properties (level 2) ([#2314](https://github.com/phpstan/phpstan-src/pull/2314)), thanks @jiripudil!
@@ -69,7 +70,6 @@ Bleeding edge (TODO move to other sections)
6970
* Report narrowing `PHPStan\Type\Type` interface via `@var` (https://github.com/phpstan/phpstan-src/commit/713b98fb107213c28e3d8c8b4b43c5f5fc47c144), https://github.com/nunomaduro/larastan/issues/1567#issuecomment-1460445389
7071
* Check invalid PHPDocs in previously unchecked statement types (https://github.com/phpstan/phpstan-src/commit/9780d352f3264aac09ac7954f691de1877db8e01)
7172
* InvalidPHPStanDocTagRule in StubValidator (https://github.com/phpstan/phpstan-src/commit/9c2552b7e744926d1a74c1ba8fd32c64079eed61)
72-
* MagicConstantContextRule ([#2741](https://github.com/phpstan/phpstan-src/pull/2741)), #10099, thanks @staabm!
7373
* TooWideMethodReturnTypehintRule - always report for final methods (https://github.com/phpstan/phpstan-src/commit/c30e9a484c8245b8126cd63444607ca74d2af761)
7474
* Report unused results of `and` and `or` (https://github.com/phpstan/phpstan-src/commit/1d8fff637d70a9e9ed3f11dee5d61b9f796cbf1a)
7575
* Report unused result of ternary (https://github.com/phpstan/phpstan-src/commit/9664f7a9d2223c07e750f0dfc949c3accfa6b65e)

conf/bleedingEdge.neon

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ parameters:
1313
alwaysCheckTooWideReturnTypeFinalMethods: true
1414
alwaysTrueAlwaysReported: true
1515
disableUnreachableBranchesRules: true
16-
magicConstantOutOfContext: true
1716
pure: true
1817
uselessReturnValue: true
1918
printfArrayParameters: true

conf/config.level0.neon

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,6 @@ conditionalTags:
1010
phpstan.rules.rule: %checkUninitializedProperties%
1111
PHPStan\Rules\Methods\MissingMagicSerializationMethodsRule:
1212
phpstan.rules.rule: %featureToggles.missingMagicSerializationRule%
13-
PHPStan\Rules\Constants\MagicConstantContextRule:
14-
phpstan.rules.rule: %featureToggles.magicConstantOutOfContext%
1513
PHPStan\Rules\Functions\UselessFunctionReturnValueRule:
1614
phpstan.rules.rule: %featureToggles.uselessReturnValue%
1715
PHPStan\Rules\Functions\PrintfArrayParametersRule:
@@ -61,6 +59,7 @@ rules:
6159
- PHPStan\Rules\Classes\TraitAttributeClassRule
6260
- PHPStan\Rules\Constants\DynamicClassConstantFetchRule
6361
- PHPStan\Rules\Constants\FinalConstantRule
62+
- PHPStan\Rules\Constants\MagicConstantContextRule
6463
- PHPStan\Rules\Constants\NativeTypedClassConstantRule
6564
- PHPStan\Rules\EnumCases\EnumCaseAttributesRule
6665
- PHPStan\Rules\Exceptions\NoncapturingCatchRule
@@ -263,9 +262,6 @@ services:
263262
-
264263
class: PHPStan\Rules\Methods\MissingMagicSerializationMethodsRule
265264

266-
-
267-
class: PHPStan\Rules\Constants\MagicConstantContextRule
268-
269265
-
270266
class: PHPStan\Rules\Functions\UselessFunctionReturnValueRule
271267

conf/config.neon

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@ parameters:
3535
alwaysTrueAlwaysReported: false
3636
disableUnreachableBranchesRules: false
3737
stricterFunctionMap: false
38-
magicConstantOutOfContext: false
3938
pure: false
4039
uselessReturnValue: false
4140
printfArrayParameters: false

conf/parametersSchema.neon

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,6 @@ parametersSchema:
4141
alwaysTrueAlwaysReported: bool()
4242
disableUnreachableBranchesRules: bool()
4343
stricterFunctionMap: bool()
44-
magicConstantOutOfContext: bool()
4544
pure: bool()
4645
uselessReturnValue: bool()
4746
printfArrayParameters: bool()

0 commit comments

Comments
 (0)