1
0
mirror of https://github.com/danog/psalm.git synced 2025-01-22 05:41:20 +01:00

Remove unnecessary assertion

This commit is contained in:
Brown 2019-09-19 15:41:44 -04:00
parent e6f90ab83f
commit f6b0de08f8

View File

@ -195,20 +195,18 @@ class AssertionFinder
throw new \UnexpectedValueException('$count_equality_position value'); throw new \UnexpectedValueException('$count_equality_position value');
} }
if ($counted_expr->args) { /** @var PhpParser\Node\Expr\FuncCall $counted_expr */
/** @var PhpParser\Node\Expr\FuncCall $counted_expr */ $var_name = ExpressionAnalyzer::getArrayVarId(
$var_name = ExpressionAnalyzer::getArrayVarId( $counted_expr->args[0]->value,
$counted_expr->args[0]->value, $this_class_name,
$this_class_name, $source
$source );
);
if ($var_name) { if ($var_name) {
if (self::hasReconcilableNonEmptyCountEqualityCheck($conditional)) { if (self::hasReconcilableNonEmptyCountEqualityCheck($conditional)) {
$if_types[$var_name] = [['non-empty-countable']]; $if_types[$var_name] = [['non-empty-countable']];
} else { } else {
$if_types[$var_name] = [['=non-empty-countable']]; $if_types[$var_name] = [['=non-empty-countable']];
}
} }
} }