From 51617da061c3bae3148f61f4186ae5ce22905554 Mon Sep 17 00:00:00 2001 From: Matthew Brown Date: Sat, 4 Dec 2021 10:06:11 -0500 Subject: [PATCH] Remove always-false args --- .../Statements/Expression/AssertionFinder.php | 26 +++++-------------- 1 file changed, 7 insertions(+), 19 deletions(-) diff --git a/src/Psalm/Internal/Analyzer/Statements/Expression/AssertionFinder.php b/src/Psalm/Internal/Analyzer/Statements/Expression/AssertionFinder.php index d4cf4319366..65092ae309c 100644 --- a/src/Psalm/Internal/Analyzer/Statements/Expression/AssertionFinder.php +++ b/src/Psalm/Internal/Analyzer/Statements/Expression/AssertionFinder.php @@ -165,7 +165,6 @@ public static function scrapeAssertions( $this_class_name, $source, $codebase, - false, //should this be $inside_negation?? $cache, $inside_conditional ); @@ -179,7 +178,6 @@ public static function scrapeAssertions( $this_class_name, $source, $codebase, - false, //should this be $inside_negation?? $cache, $inside_conditional ); @@ -324,7 +322,6 @@ private static function scrapeEqualityAssertions( ?string $this_class_name, FileSource $source, ?Codebase $codebase = null, - bool $inside_negation = false, bool $cache = true, bool $inside_conditional = true ): array { @@ -348,7 +345,6 @@ private static function scrapeEqualityAssertions( $this_class_name, $source, $codebase, - $inside_negation, $cache, $true_position ); @@ -362,7 +358,6 @@ private static function scrapeEqualityAssertions( $this_class_name, $source, $codebase, - $inside_negation, $cache, $inside_conditional, $false_position @@ -562,7 +557,6 @@ private static function scrapeInequalityAssertions( ?string $this_class_name, FileSource $source, ?Codebase $codebase = null, - bool $inside_negation = false, bool $cache = true, bool $inside_conditional = true ): array { @@ -588,7 +582,6 @@ private static function scrapeInequalityAssertions( $source, $inside_conditional, $codebase, - $inside_negation, $false_position ); } @@ -602,7 +595,6 @@ private static function scrapeInequalityAssertions( $this_class_name, $source, $codebase, - $inside_negation, $cache, $inside_conditional ); @@ -2074,7 +2066,6 @@ private static function getFalseInequalityAssertions( FileSource $source, bool $inside_conditional, ?Codebase $codebase, - bool $inside_negation, int $false_position ): array { $if_types = []; @@ -2114,7 +2105,7 @@ private static function getFalseInequalityAssertions( $this_class_name, $source, $codebase, - $inside_negation, + false, $cache, $inside_conditional ); @@ -2192,7 +2183,6 @@ private static function getTrueInequalityAssertions( ?string $this_class_name, FileSource $source, ?Codebase $codebase, - bool $inside_negation, bool $cache, bool $inside_conditional ): array { @@ -2212,7 +2202,7 @@ private static function getTrueInequalityAssertions( $this_class_name, $source, $codebase, - !$inside_negation + true ); } else { $var_name = ExpressionIdentifier::getArrayVarId( @@ -2242,7 +2232,7 @@ private static function getTrueInequalityAssertions( $this_class_name, $source, $codebase, - $inside_negation, + false, $cache, $inside_conditional ); @@ -2770,7 +2760,6 @@ private static function getTrueEqualityAssertions( ?string $this_class_name, FileSource $source, ?Codebase $codebase, - bool $inside_negation, bool $cache, int $true_position ): array { @@ -2790,7 +2779,7 @@ private static function getTrueEqualityAssertions( $this_class_name, $source, $codebase, - $inside_negation + false ); } else { $var_name = ExpressionIdentifier::getArrayVarId( @@ -2820,7 +2809,7 @@ private static function getTrueEqualityAssertions( $this_class_name, $source, $codebase, - $inside_negation, + false, $cache ); @@ -2895,7 +2884,6 @@ private static function getFalseEqualityAssertions( ?string $this_class_name, FileSource $source, ?Codebase $codebase, - bool $inside_negation, bool $cache, bool $inside_conditional, int $false_position @@ -2916,7 +2904,7 @@ private static function getFalseEqualityAssertions( $this_class_name, $source, $codebase, - !$inside_negation + true ); } else { $var_name = ExpressionIdentifier::getArrayVarId( @@ -2946,7 +2934,7 @@ private static function getFalseEqualityAssertions( $this_class_name, $source, $codebase, - $inside_negation, + false, $cache, $inside_conditional );