Skip to content

Commit 3654e52

Browse files
authored
Merge branch 'phpstan:2.1.x' into Assert-and-throws-are-side-effects
2 parents c53d764 + 5bfe8f1 commit 3654e52

File tree

189 files changed

+8332
-559
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

189 files changed

+8332
-559
lines changed

Makefile

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ lint:
4343
--exclude tests/PHPStan/Rules/Functions/data/arrow-function-nullsafe-by-ref.php \
4444
--exclude tests/PHPStan/Levels/data/namedArguments.php \
4545
--exclude tests/PHPStan/Rules/Keywords/data/continue-break.php \
46+
--exclude tests/PHPStan/Rules/Keywords/data/continue-break-property-hook.php \
4647
--exclude tests/PHPStan/Rules/Properties/data/invalid-callable-property-type.php \
4748
--exclude tests/PHPStan/Rules/Properties/data/properties-in-interface.php \
4849
--exclude tests/PHPStan/Rules/Properties/data/read-only-property.php \
@@ -89,6 +90,12 @@ lint:
8990
--exclude tests/PHPStan/Rules/Properties/data/hooked-properties-without-bodies-in-class.php \
9091
--exclude tests/PHPStan/Rules/Classes/data/bug-12281.php \
9192
--exclude tests/PHPStan/Rules/Traits/data/bug-12281.php \
93+
--exclude tests/PHPStan/Rules/Classes/data/invalid-hooked-properties.php \
94+
--exclude tests/PHPStan/Parser/data/cleaning-property-hooks-before.php \
95+
--exclude tests/PHPStan/Parser/data/cleaning-property-hooks-after.php \
96+
--exclude tests/PHPStan/Rules/Properties/data/existing-classes-property-hooks.php \
97+
--exclude tests/PHPStan/Rules/Properties/data/set-property-hook-parameter.php \
98+
--exclude tests/PHPStan/Rules/Properties/data/overriding-final-property.php \
9299
src tests
93100

94101
cs:

build/collision-detector.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@
55
"../tests/PHPStan/Analyser/data/multipleParseErrors.php",
66
"../tests/PHPStan/Parser/data/cleaning-1-before.php",
77
"../tests/PHPStan/Parser/data/cleaning-1-after.php",
8+
"../tests/PHPStan/Parser/data/cleaning-property-hooks-before.php",
9+
"../tests/PHPStan/Parser/data/cleaning-property-hooks-after.php",
810
"../tests/PHPStan/Rules/Functions/data/duplicate-function.php",
911
"../tests/PHPStan/Rules/Classes/data/duplicate-class.php",
1012
"../tests/PHPStan/Rules/Names/data/multiple-namespaces.php",

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
"hoa/compiler": "3.17.08.08",
1616
"hoa/exception": "^1.0",
1717
"hoa/file": "1.17.07.11",
18-
"jetbrains/phpstorm-stubs": "dev-master#0e82bdfe850c71857ee4ee3501ed82a9fc5d043c",
18+
"jetbrains/phpstorm-stubs": "dev-master#db675e059f57071e8209c99075128b92d8a727e7",
1919
"nette/bootstrap": "^3.0",
2020
"nette/di": "^3.1.4",
2121
"nette/neon": "3.3.4",

composer.lock

Lines changed: 9 additions & 9 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

conf/config.level0.neon

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -92,11 +92,14 @@ rules:
9292
- PHPStan\Rules\Operators\InvalidIncDecOperationRule
9393
- PHPStan\Rules\Properties\AccessPropertiesInAssignRule
9494
- PHPStan\Rules\Properties\AccessStaticPropertiesInAssignRule
95+
- PHPStan\Rules\Properties\ExistingClassesInPropertyHookTypehintsRule
9596
- PHPStan\Rules\Properties\InvalidCallablePropertyTypeRule
9697
- PHPStan\Rules\Properties\MissingReadOnlyPropertyAssignRule
9798
- PHPStan\Rules\Properties\MissingReadOnlyByPhpDocPropertyAssignRule
9899
- PHPStan\Rules\Properties\PropertiesInInterfaceRule
100+
- PHPStan\Rules\Properties\PropertyAssignRefRule
99101
- PHPStan\Rules\Properties\PropertyAttributesRule
102+
- PHPStan\Rules\Properties\PropertyHookAttributesRule
100103
- PHPStan\Rules\Properties\PropertyInClassRule
101104
- PHPStan\Rules\Properties\ReadOnlyPropertyRule
102105
- PHPStan\Rules\Properties\ReadOnlyByPhpDocPropertyRule
@@ -177,9 +180,6 @@ services:
177180
class: PHPStan\Rules\Properties\AccessPropertiesRule
178181
tags:
179182
- phpstan.rules.rule
180-
arguments:
181-
reportMagicProperties: %reportMagicProperties%
182-
checkDynamicProperties: %checkDynamicProperties%
183183

184184
-
185185
class: PHPStan\Rules\Properties\AccessStaticPropertiesRule
@@ -210,6 +210,14 @@ services:
210210
tags:
211211
- phpstan.rules.rule
212212

213+
-
214+
class: PHPStan\Rules\Properties\SetPropertyHookParameterRule
215+
arguments:
216+
checkPhpDocMethodSignatures: %checkPhpDocMethodSignatures%
217+
checkMissingTypehints: %checkMissingTypehints%
218+
tags:
219+
- phpstan.rules.rule
220+
213221
-
214222
class: PHPStan\Rules\Properties\UninitializedPropertyRule
215223

conf/config.level2.neon

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ rules:
5252
- PHPStan\Rules\PhpDoc\IncompatibleSelfOutTypeRule
5353
- PHPStan\Rules\PhpDoc\IncompatibleClassConstantPhpDocTypeRule
5454
- PHPStan\Rules\PhpDoc\IncompatiblePhpDocTypeRule
55+
- PHPStan\Rules\PhpDoc\IncompatiblePropertyHookPhpDocTypeRule
5556
- PHPStan\Rules\PhpDoc\IncompatiblePropertyPhpDocTypeRule
5657
- PHPStan\Rules\PhpDoc\InvalidThrowsPhpDocValueRule
5758
- PHPStan\Rules\PhpDoc\IncompatibleParamImmediatelyInvokedCallableRule

conf/config.level3.neon

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,13 @@ rules:
1616
- PHPStan\Rules\Generators\YieldTypeRule
1717
- PHPStan\Rules\Methods\ReturnTypeRule
1818
- PHPStan\Rules\Properties\DefaultValueTypesAssignedToPropertiesRule
19+
- PHPStan\Rules\Properties\GetNonVirtualPropertyHookReadRule
1920
- PHPStan\Rules\Properties\ReadOnlyPropertyAssignRule
2021
- PHPStan\Rules\Properties\ReadOnlyByPhpDocPropertyAssignRule
2122
- PHPStan\Rules\Properties\ReadOnlyPropertyAssignRefRule
2223
- PHPStan\Rules\Properties\ReadOnlyByPhpDocPropertyAssignRefRule
24+
- PHPStan\Rules\Properties\SetNonVirtualPropertyHookAssignRule
25+
- PHPStan\Rules\Properties\ShortGetPropertyHookReturnTypeRule
2326
- PHPStan\Rules\Properties\TypesAssignedToPropertiesRule
2427
- PHPStan\Rules\Variables\ParameterOutAssignedTypeRule
2528
- PHPStan\Rules\Variables\ParameterOutExecutionEndTypeRule
@@ -66,6 +69,14 @@ services:
6669
tags:
6770
- phpstan.rules.rule
6871

72+
-
73+
class: PHPStan\Rules\Exceptions\ThrowsVoidPropertyHookWithExplicitThrowPointRule
74+
arguments:
75+
exceptionTypeResolver: @exceptionTypeResolver
76+
missingCheckedExceptionInThrows: %exceptions.check.missingCheckedExceptionInThrows%
77+
tags:
78+
- phpstan.rules.rule
79+
6980
-
7081
class: PHPStan\Rules\Generators\YieldFromTypeRule
7182
arguments:

conf/config.level4.neon

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,8 @@ conditionalTags:
3131
phpstan.rules.rule: %exceptions.check.tooWideThrowType%
3232
PHPStan\Rules\Exceptions\TooWideMethodThrowTypeRule:
3333
phpstan.rules.rule: %exceptions.check.tooWideThrowType%
34+
PHPStan\Rules\Exceptions\TooWidePropertyHookThrowTypeRule:
35+
phpstan.rules.rule: %exceptions.check.tooWideThrowType%
3436

3537
parameters:
3638
checkAdvancedIsset: true
@@ -241,6 +243,9 @@ services:
241243
-
242244
class: PHPStan\Rules\Exceptions\TooWideMethodThrowTypeRule
243245

246+
-
247+
class: PHPStan\Rules\Exceptions\TooWidePropertyHookThrowTypeRule
248+
244249
-
245250
class: PHPStan\Rules\TooWideTypehints\TooWideMethodReturnTypehintRule
246251
arguments:

conf/config.neon

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -209,6 +209,8 @@ conditionalTags:
209209
phpstan.rules.rule: %exceptions.check.missingCheckedExceptionInThrows%
210210
PHPStan\Rules\Exceptions\MissingCheckedExceptionInMethodThrowsRule:
211211
phpstan.rules.rule: %exceptions.check.missingCheckedExceptionInThrows%
212+
PHPStan\Rules\Exceptions\MissingCheckedExceptionInPropertyHookThrowsRule:
213+
phpstan.rules.rule: %exceptions.check.missingCheckedExceptionInThrows%
212214

213215
services:
214216
-
@@ -318,6 +320,11 @@ services:
318320
tags:
319321
- phpstan.parser.richParserNodeVisitor
320322

323+
-
324+
class: PHPStan\Parser\PropertyHookNameVisitor
325+
tags:
326+
- phpstan.parser.richParserNodeVisitor
327+
321328
-
322329
class: PHPStan\Node\Printer\ExprPrinter
323330

@@ -901,6 +908,9 @@ services:
901908
-
902909
class: PHPStan\Rules\Exceptions\MissingCheckedExceptionInMethodThrowsRule
903910

911+
-
912+
class: PHPStan\Rules\Exceptions\MissingCheckedExceptionInPropertyHookThrowsRule
913+
904914
-
905915
class: PHPStan\Rules\Exceptions\MissingCheckedExceptionInThrowsCheck
906916
arguments:
@@ -1011,6 +1021,9 @@ services:
10111021
-
10121022
class: PHPStan\Rules\PhpDoc\GenericCallableRuleHelper
10131023

1024+
-
1025+
class: PHPStan\Rules\PhpDoc\IncompatiblePhpDocTypeCheck
1026+
10141027
-
10151028
class: PHPStan\Rules\PhpDoc\VarTagTypeRuleHelper
10161029
arguments:
@@ -1020,6 +1033,12 @@ services:
10201033
-
10211034
class: PHPStan\Rules\Playground\NeverRuleHelper
10221035

1036+
-
1037+
class: PHPStan\Rules\Properties\AccessPropertiesCheck
1038+
arguments:
1039+
reportMagicProperties: %reportMagicProperties%
1040+
checkDynamicProperties: %checkDynamicProperties%
1041+
10231042
-
10241043
class: PHPStan\Rules\Properties\LazyReadWritePropertiesExtensionProvider
10251044

0 commit comments

Comments
 (0)