mirror of
https://github.com/danog/psalm.git
synced 2024-12-14 02:07:37 +01:00
Unrelated: Use strict_equality instead of loose_equality for ===
checks
(`=` is strict equality, `~` is loose equality)
This commit is contained in:
parent
f69a255611
commit
7df819e585
@ -465,7 +465,7 @@ class AssertionFinder
|
|||||||
|
|
||||||
if ($var_name_left &&
|
if ($var_name_left &&
|
||||||
(!$var_type->isSingle() || $var_type->getAssertionString() !== $assertion)) {
|
(!$var_type->isSingle() || $var_type->getAssertionString() !== $assertion)) {
|
||||||
$if_types[$var_name_left] = [['~'.$assertion]];
|
$if_types[$var_name_left] = [['='.$assertion]];
|
||||||
}
|
}
|
||||||
|
|
||||||
$var_name_right = ExpressionIdentifier::getArrayVarId(
|
$var_name_right = ExpressionIdentifier::getArrayVarId(
|
||||||
@ -476,7 +476,7 @@ class AssertionFinder
|
|||||||
|
|
||||||
if ($var_name_right &&
|
if ($var_name_right &&
|
||||||
(!$other_type->isSingle() || $other_type->getAssertionString() !== $assertion)) {
|
(!$other_type->isSingle() || $other_type->getAssertionString() !== $assertion)) {
|
||||||
$if_types[$var_name_right] = [['~'.$assertion]];
|
$if_types[$var_name_right] = [['='.$assertion]];
|
||||||
}
|
}
|
||||||
|
|
||||||
return $if_types ? [$if_types] : [];
|
return $if_types ? [$if_types] : [];
|
||||||
@ -3456,14 +3456,13 @@ class AssertionFinder
|
|||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
foreach ($value_type->getAtomicTypes() as $atomic_value_type) {
|
foreach ($value_type->getAtomicTypes() as $atomic_value_type) {
|
||||||
if ($atomic_value_type instanceof Type\Atomic\TLiteralInt
|
if ($atomic_value_type instanceof Type\Atomic\TFalse
|
||||||
|| $atomic_value_type instanceof Type\Atomic\TLiteralString
|
|| $atomic_value_type instanceof Type\Atomic\TTrue
|
||||||
|| $atomic_value_type instanceof Type\Atomic\TLiteralFloat
|
|| $atomic_value_type instanceof Type\Atomic\TNull
|
||||||
|| $atomic_value_type instanceof Type\Atomic\TEnumCase
|
|
||||||
) {
|
) {
|
||||||
$assertions[] = '=' . $atomic_value_type->getAssertionString();
|
|
||||||
} else {
|
|
||||||
$assertions[] = $atomic_value_type->getAssertionString();
|
$assertions[] = $atomic_value_type->getAssertionString();
|
||||||
|
} else {
|
||||||
|
$assertions[] = '=' . $atomic_value_type->getAssertionString();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user