Skip to content

Commit 6703fce

Browse files
committed
[BE] Report useless return values of function calls like var_export without $return=true
1 parent d419f43 commit 6703fce

File tree

5 files changed

+2
-8
lines changed

5 files changed

+2
-8
lines changed

changelog-2.0.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ Major new features 🚀
2121
* Check preg_quote delimiter sanity (level 0) ([#3252](https://github.com/phpstan/phpstan-src/pull/3252)), #11338, thanks @staabm!
2222
* MagicConstantContextRule (level 0) ([#2741](https://github.com/phpstan/phpstan-src/pull/2741)), #10099, thanks @staabm!
2323
* MissingMagicSerializationMethodsRule (level 0) ([#1711](https://github.com/phpstan/phpstan-src/pull/1711)), #7482, thanks @staabm!
24+
* Report useless return values of function calls like `var_export` without `$return=true` (level 0) ([#3225](https://github.com/phpstan/phpstan-src/pull/3225)), #11320, thanks @staabm!
2425
* Rule for `call_user_func()` (level 5) ([#2479](https://github.com/phpstan/phpstan-src/pull/2479)), thanks @staabm!
2526
* Check array functions which require stringish values (level 5) ([#3132](https://github.com/phpstan/phpstan-src/pull/3132)), #11141, #5848, #3694, #11111, thanks @schlndh!
2627
* Check variance of template types in properties (level 2) ([#2314](https://github.com/phpstan/phpstan-src/pull/2314)), thanks @jiripudil!
@@ -86,7 +87,6 @@ Bleeding edge (TODO move to other sections)
8687
* CallToConstructorStatementWithoutSideEffectsRule - report class with no constructor (https://github.com/phpstan/phpstan-src/commit/b116d25a6e4ba6c09f59af6569d9e6f6fd20aff4)
8788
* Check if required file exists ([#3294](https://github.com/phpstan/phpstan-src/pull/3294)), #3397, thanks @Bellangelo!
8889
* Check `@param-immediately-invoked-callable` and `@param-later-invoked-callable` (https://github.com/phpstan/phpstan-src/commit/580a6add422f4e34191df9e7a77ba1655e914bda), #10932
89-
* Report useless return values of function calls like `var_export` without `$return=true` ([#3225](https://github.com/phpstan/phpstan-src/pull/3225)), #11320, thanks @staabm!
9090
* Check vprintf/vsprintf arguments against placeholder count ([#3126](https://github.com/phpstan/phpstan-src/pull/3126)), thanks @staabm!
9191

9292
Improvements 🔧

conf/bleedingEdge.neon

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

conf/config.level0.neon

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,6 @@ conditionalTags:
88
phpstan.rules.rule: %featureToggles.readOnlyByPhpDoc%
99
PHPStan\Rules\Properties\UninitializedPropertyRule:
1010
phpstan.rules.rule: %checkUninitializedProperties%
11-
PHPStan\Rules\Functions\UselessFunctionReturnValueRule:
12-
phpstan.rules.rule: %featureToggles.uselessReturnValue%
1311
PHPStan\Rules\Functions\PrintfArrayParametersRule:
1412
phpstan.rules.rule: %featureToggles.printfArrayParameters%
1513
PHPStan\Rules\Keywords\RequireFileExistsRule:
@@ -77,6 +75,7 @@ rules:
7775
- PHPStan\Rules\Functions\PrintfParametersRule
7876
- PHPStan\Rules\Functions\RedefinedParametersRule
7977
- PHPStan\Rules\Functions\ReturnNullsafeByRefRule
78+
- PHPStan\Rules\Functions\UselessFunctionReturnValueRule
8079
- PHPStan\Rules\Ignore\IgnoreParseErrorRule
8180
- PHPStan\Rules\Functions\VariadicParametersDeclarationRule
8281
- PHPStan\Rules\Keywords\ContinueBreakInLoopRule
@@ -258,8 +257,6 @@ services:
258257
arguments:
259258
additionalConstructors: %additionalConstructors%
260259

261-
-
262-
class: PHPStan\Rules\Functions\UselessFunctionReturnValueRule
263260

264261
-
265262
class: PHPStan\Rules\Functions\PrintfArrayParametersRule

conf/config.neon

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

conf/parametersSchema.neon

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

0 commit comments

Comments
 (0)