File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -7,6 +7,7 @@ parameters:
77 stricterFunctionMap : true
88 reportPreciseLineForUnusedFunctionParameter : true
99 checkPrintfParameterTypes : true
10+ checkUnserializeFunction : true
1011 internalTag : true
1112 newStaticInAbstractClassStaticMethod : true
1213 checkExtensionsForComparisonOperators : true
Original file line number Diff line number Diff line change @@ -14,6 +14,8 @@ conditionalTags:
1414 phpstan.rules.rule : %featureToggles.checkDateIntervalConstructor%
1515 PHPStan\Rules\Functions\SortWithoutEffectRule :
1616 phpstan.rules.rule : %featureToggles.sortWithoutEffect%
17+ PHPStan\Rules\Functions\UnserializeRule :
18+ phpstan.rules.rule : %featureToggles.checkUnserializeFunction%
1719
1820autowiredAttributeServices :
1921 # registers rules with #[RegisteredRule] attribute
@@ -33,3 +35,7 @@ services:
3335 arguments :
3436 treatPhpDocTypesAsCertain : %treatPhpDocTypesAsCertain%
3537 treatPhpDocTypesAsCertainTip : %tips.treatPhpDocTypesAsCertain%
38+ -
39+ class : PHPStan\Rules\Functions\UnserializeRule
40+ arguments :
41+ checkInsecureUnserialize : %checkInsecureUnserialize%
Original file line number Diff line number Diff line change @@ -39,6 +39,7 @@ parameters:
3939 stricterFunctionMap : false
4040 reportPreciseLineForUnusedFunctionParameter : false
4141 checkPrintfParameterTypes : false
42+ checkUnserializeFunction : false
4243 internalTag : false
4344 newStaticInAbstractClassStaticMethod : false
4445 checkExtensionsForComparisonOperators : false
Original file line number Diff line number Diff line change @@ -36,6 +36,7 @@ parametersSchema:
3636 stricterFunctionMap : bool ()
3737 reportPreciseLineForUnusedFunctionParameter : bool ()
3838 checkPrintfParameterTypes : bool ()
39+ checkUnserializeFunction : bool ()
3940 internalTag : bool ()
4041 newStaticInAbstractClassStaticMethod : bool ()
4142 checkExtensionsForComparisonOperators : bool ()
Original file line number Diff line number Diff line change 66use PhpParser \Node \Expr \FuncCall ;
77use PHPStan \Analyser \ArgumentsNormalizer ;
88use PHPStan \Analyser \Scope ;
9- use PHPStan \DependencyInjection \AutowiredParameter ;
10- use PHPStan \DependencyInjection \RegisteredRule ;
119use PHPStan \Php \PhpVersion ;
1210use PHPStan \Reflection \ParametersAcceptorSelector ;
1311use PHPStan \Reflection \ReflectionProvider ;
2018/**
2119 * @implements Rule<Node\Expr\FuncCall>
2220 */
23- #[RegisteredRule(level: 5 )]
2421final class UnserializeRule implements Rule
2522{
2623
2724 public function __construct (
2825 private readonly PhpVersion $ phpVersion ,
2926 private readonly ReflectionProvider $ reflectionProvider ,
30- #[AutowiredParameter]
3127 private readonly bool $ checkInsecureUnserialize ,
3228 )
3329 {
You can’t perform that action at this time.
0 commit comments