From 14f8fb8ecd9d75b13c565e85ad9555acbac01846 Mon Sep 17 00:00:00 2001 From: Matthew Brown Date: Sun, 9 Feb 2020 11:45:43 -0500 Subject: [PATCH] Fix two redundant asserts --- .../ReturnTypeProvider/ArrayFilterReturnTypeProvider.php | 2 -- .../ReturnTypeProvider/IteratorToArrayReturnTypeProvider.php | 2 -- 2 files changed, 4 deletions(-) diff --git a/src/Psalm/Internal/Provider/ReturnTypeProvider/ArrayFilterReturnTypeProvider.php b/src/Psalm/Internal/Provider/ReturnTypeProvider/ArrayFilterReturnTypeProvider.php index 85a30b12e..a5867471c 100644 --- a/src/Psalm/Internal/Provider/ReturnTypeProvider/ArrayFilterReturnTypeProvider.php +++ b/src/Psalm/Internal/Provider/ReturnTypeProvider/ArrayFilterReturnTypeProvider.php @@ -194,8 +194,6 @@ class ArrayFilterReturnTypeProvider implements \Psalm\Plugin\Hook\FunctionReturn if (isset($assertions['$' . $first_param->var->name])) { $changed_var_ids = []; - assert($statements_source instanceof \Psalm\Internal\Analyzer\StatementsAnalyzer); - $assertions = ['$inner_type' => $assertions['$' . $first_param->var->name]]; $reconciled_types = Reconciler::reconcileKeyedTypes( diff --git a/src/Psalm/Internal/Provider/ReturnTypeProvider/IteratorToArrayReturnTypeProvider.php b/src/Psalm/Internal/Provider/ReturnTypeProvider/IteratorToArrayReturnTypeProvider.php index ff7d977a2..1dee15ff6 100644 --- a/src/Psalm/Internal/Provider/ReturnTypeProvider/IteratorToArrayReturnTypeProvider.php +++ b/src/Psalm/Internal/Provider/ReturnTypeProvider/IteratorToArrayReturnTypeProvider.php @@ -50,8 +50,6 @@ class IteratorToArrayReturnTypeProvider implements \Psalm\Plugin\Hook\FunctionRe new Type\Atomic\TIterable([Type::getMixed(), Type::getMixed()]) ) ) { - assert($statements_source instanceof \Psalm\Internal\Analyzer\StatementsAnalyzer); - $has_valid_iterator = true; ForeachAnalyzer::handleIterable( $statements_source,