mirror of
https://github.com/danog/psalm.git
synced 2025-01-21 21:31:13 +01:00
Fix null checks
This commit is contained in:
parent
41e076e0ee
commit
ed4f4e35b8
@ -926,7 +926,10 @@ class BinaryOpAnalyzer
|
||||
$statements_analyzer->node_data->setType($stmt, Type::getBool());
|
||||
}
|
||||
|
||||
if ($stmt instanceof PhpParser\Node\Expr\BinaryOp\Equal) {
|
||||
if ($stmt instanceof PhpParser\Node\Expr\BinaryOp\Equal
|
||||
&& $stmt_left_type
|
||||
&& $stmt_right_type
|
||||
) {
|
||||
if ($stmt_left_type->hasString() && $stmt_right_type->hasObjectType()) {
|
||||
foreach ($stmt_right_type->getAtomicTypes() as $atomic_type) {
|
||||
if ($atomic_type instanceof TNamedObject) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user