1
0
mirror of https://github.com/danog/psalm.git synced 2024-11-27 12:55:26 +01:00

restore paradox checking

This commit is contained in:
orklah 2021-09-04 22:57:08 +02:00
parent 667eec2ac8
commit 7bf9df4360

View File

@ -372,6 +372,10 @@ class AssertionFinder
);
}
if (!$source instanceof StatementsAnalyzer) {
return [];
}
$min_count = null;
$count_equality_position = self::hasCountEqualityCheck($conditional, $min_count);
@ -393,6 +397,24 @@ class AssertionFinder
$source
);
$var_type = $source->node_data->getType($conditional->left);
$other_type = $source->node_data->getType($conditional->right);
if ($codebase
&& $other_type
&& $var_type
&& $conditional instanceof PhpParser\Node\Expr\BinaryOp\Identical
) {
self::handleParadoxicalAssertions(
$source,
$var_type,
$this_class_name,
$other_type,
$codebase,
$conditional
);
}
if ($var_name) {
if ($min_count) {
$if_types[$var_name] = [['=has-at-least-' . $min_count]];
@ -404,10 +426,6 @@ class AssertionFinder
return $if_types ? [$if_types] : [];
}
if (!$source instanceof StatementsAnalyzer) {
return [];
}
$getclass_position = self::hasGetClassCheck($conditional, $source);
if ($getclass_position) {