Skip to content

Commit 27ab11b

Browse files
committed
[BE] Check code in custom PHPStan extensions for runtime reflection concepts
1 parent 80ad11e commit 27ab11b

File tree

5 files changed

+10
-25
lines changed

5 files changed

+10
-25
lines changed

changelog-2.0.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,12 @@ Major new features 🚀
3333
* Check missing types in `@phpstan-self-out` (https://github.com/phpstan/phpstan-src/commit/892b319f25f04bc1b55c3d0063b607909612fe6d)
3434
* Check missing types in local type aliases (https://github.com/phpstan/phpstan-src/commit/ce7ffaf02d624a7fb9d38f8e5dffc9739f1233fc)
3535
* Check missing types in `@mixin` (https://github.com/phpstan/phpstan-src/commit/3175c81f26fd5bcb4a161b24e774921870ed2533)
36+
* Check code in custom PHPStan extensions for runtime reflection concepts like `is_a()` or `class_parents()` (level 0) (https://github.com/phpstan/phpstan-src/commit/c4a662ac6c3ec63f063238880b243b5399c34fcc)
37+
* Check code in custom PHPStan extensions for runtime reflection concepts like `new ReflectionMethod()` (level 0) (https://github.com/phpstan/phpstan-src/commit/536306611cbb5877b6565755cd07b87f9ccfdf08)
38+
* ApiInstanceofRule (level 0)
39+
* Report `instanceof` of classes not covered by backward compatibility promise (https://github.com/phpstan/phpstan-src/commit/ff4d02d62a7a2e2c4d928d48d31d49246dba7139)
40+
* Report `instanceof` of classes covered by backward compatibility promise but where the assumption might change (https://github.com/phpstan/phpstan-src/commit/996bc69fa977aa64f601bd82b8a0ae39be0cbeef)
41+
* Check that PHPStan class in class constant fetch is covered by backward compatibility promise (level 0) (https://github.com/phpstan/phpstan-src/commit/9e007251ce61788f6a0319a53f1de6cf801ed233)
3642

3743
Bleeding edge (TODO move to other sections)
3844
=====================
@@ -45,12 +51,6 @@ Bleeding edge (TODO move to other sections)
4551
* Unresolvable parameters ([#1319](https://github.com/phpstan/phpstan-src/pull/1319)), thanks @rvanvelzen!
4652
* 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!
4753
* 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)
48-
* Check that PHPStan class in class constant fetch is covered by backward compatibility promise (https://github.com/phpstan/phpstan-src/commit/9e007251ce61788f6a0319a53f1de6cf801ed233)
49-
* Check code in custom PHPStan extensions for runtime reflection concepts like `is_a()` or `class_parents()` (https://github.com/phpstan/phpstan-src/commit/c4a662ac6c3ec63f063238880b243b5399c34fcc)
50-
* Check code in custom PHPStan extensions for runtime reflection concepts like `new ReflectionMethod()` (https://github.com/phpstan/phpstan-src/commit/536306611cbb5877b6565755cd07b87f9ccfdf08)
51-
* ApiInstanceofRule
52-
* Report `instanceof` of classes not covered by backward compatibility promise (https://github.com/phpstan/phpstan-src/commit/ff4d02d62a7a2e2c4d928d48d31d49246dba7139)
53-
* Report `instanceof` of classes covered by backward compatibility promise but where the assumption might change (https://github.com/phpstan/phpstan-src/commit/996bc69fa977aa64f601bd82b8a0ae39be0cbeef)
5454
* Add `@readonly` rule that disallows default values ([#1391](https://github.com/phpstan/phpstan-src/pull/1391)), thanks @herndlm!
5555
* MissingMagicSerializationMethodsRule ([#1711](https://github.com/phpstan/phpstan-src/pull/1711)), #7482, thanks @staabm!
5656
* Change `curl_setopt` function signature based on 2nd arg ([#1719](https://github.com/phpstan/phpstan-src/pull/1719)), thanks @staabm!

conf/bleedingEdge.neon

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ parameters:
1313
consistentConstructor: true
1414
checkUnresolvableParameterTypes: true
1515
readOnlyByPhpDoc: true
16-
runtimeReflectionRules: true
1716
curlSetOptTypes: true
1817
missingMagicSerializationRule: true
1918
alwaysCheckTooWideReturnTypeFinalMethods: true

conf/config.level0.neon

Lines changed: 4 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,6 @@ conditionalTags:
1010
phpstan.rules.rule: %checkUninitializedProperties%
1111
PHPStan\Rules\Methods\ConsistentConstructorRule:
1212
phpstan.rules.rule: %featureToggles.consistentConstructor%
13-
PHPStan\Rules\Api\ApiClassConstFetchRule:
14-
phpstan.rules.rule: %featureToggles.runtimeReflectionRules%
15-
PHPStan\Rules\Api\ApiInstanceofRule:
16-
phpstan.rules.rule: %featureToggles.runtimeReflectionRules%
17-
PHPStan\Rules\Api\RuntimeReflectionFunctionRule:
18-
phpstan.rules.rule: %featureToggles.runtimeReflectionRules%
19-
PHPStan\Rules\Api\RuntimeReflectionInstantiationRule:
20-
phpstan.rules.rule: %featureToggles.runtimeReflectionRules%
2113
PHPStan\Rules\Methods\MissingMagicSerializationMethodsRule:
2214
phpstan.rules.rule: %featureToggles.missingMagicSerializationRule%
2315
PHPStan\Rules\Constants\MagicConstantContextRule:
@@ -30,7 +22,9 @@ conditionalTags:
3022
phpstan.rules.rule: %featureToggles.requireFileExists%
3123

3224
rules:
25+
- PHPStan\Rules\Api\ApiInstanceofRule
3326
- PHPStan\Rules\Api\ApiInstantiationRule
27+
- PHPStan\Rules\Api\ApiClassConstFetchRule
3428
- PHPStan\Rules\Api\ApiClassExtendsRule
3529
- PHPStan\Rules\Api\ApiClassImplementsRule
3630
- PHPStan\Rules\Api\ApiInterfaceExtendsRule
@@ -40,6 +34,8 @@ rules:
4034
- PHPStan\Rules\Api\GetTemplateTypeRule
4135
- PHPStan\Rules\Api\NodeConnectingVisitorAttributesRule
4236
- PHPStan\Rules\Api\PhpStanNamespaceIn3rdPartyPackageRule
37+
- PHPStan\Rules\Api\RuntimeReflectionInstantiationRule
38+
- PHPStan\Rules\Api\RuntimeReflectionFunctionRule
4339
- PHPStan\Rules\Arrays\DuplicateKeysInLiteralArraysRule
4440
- PHPStan\Rules\Arrays\EmptyArrayItemRule
4541
- PHPStan\Rules\Arrays\OffsetAccessWithoutDimForReadingRule
@@ -120,21 +116,13 @@ rules:
120116
- PHPStan\Rules\Whitespace\FileWhitespaceRule
121117

122118
services:
123-
-
124-
class: PHPStan\Rules\Api\ApiClassConstFetchRule
125-
-
126-
class: PHPStan\Rules\Api\ApiInstanceofRule
127119
-
128120
class: PHPStan\Rules\Api\ApiInstanceofTypeRule
129121
arguments:
130122
enabled: %featureToggles.instanceofType%
131123
deprecationRulesInstalled: %deprecationRulesInstalled%
132124
tags:
133125
- phpstan.rules.rule
134-
-
135-
class: PHPStan\Rules\Api\RuntimeReflectionFunctionRule
136-
-
137-
class: PHPStan\Rules\Api\RuntimeReflectionInstantiationRule
138126
-
139127
class: PHPStan\Rules\Classes\ExistingClassInClassExtendsRule
140128
tags:

conf/config.neon

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,6 @@ parameters:
3434
consistentConstructor: false
3535
checkUnresolvableParameterTypes: false
3636
readOnlyByPhpDoc: false
37-
runtimeReflectionRules: false
3837
curlSetOptTypes: false
3938
missingMagicSerializationRule: false
4039
alwaysCheckTooWideReturnTypeFinalMethods: false

conf/parametersSchema.neon

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,6 @@ parametersSchema:
4040
consistentConstructor: bool()
4141
checkUnresolvableParameterTypes: bool()
4242
readOnlyByPhpDoc: bool()
43-
runtimeReflectionRules: bool()
4443
curlSetOptTypes: bool()
4544
missingMagicSerializationRule: bool()
4645
alwaysCheckTooWideReturnTypeFinalMethods: bool()

0 commit comments

Comments
 (0)