mirror of
https://github.com/danog/psalm.git
synced 2024-11-30 04:39:00 +01:00
Prevent undefined property notices
This commit is contained in:
parent
14bb967c7d
commit
e02999f2ba
@ -264,8 +264,8 @@ class AssertionFinder
|
||||
$source
|
||||
);
|
||||
|
||||
$var_type = $conditional->right->inferredType;
|
||||
$other_type = $conditional->left->inferredType;
|
||||
$other_type = isset($conditional->left->inferredType) ? $conditional->left->inferredType : null;
|
||||
$var_type = isset($conditional->right->inferredType) ? $conditional->right->inferredType : null;
|
||||
} elseif ($typed_value_position === self::ASSIGNMENT_TO_LEFT) {
|
||||
/** @var PhpParser\Node\Expr $conditional->left */
|
||||
$var_name = ExpressionChecker::getArrayVarId(
|
||||
@ -274,8 +274,8 @@ class AssertionFinder
|
||||
$source
|
||||
);
|
||||
|
||||
$var_type = $conditional->left->inferredType;
|
||||
$other_type = $conditional->right->inferredType;
|
||||
$var_type = isset($conditional->left->inferredType) ? $conditional->left->inferredType : null;
|
||||
$other_type = isset($conditional->right->inferredType) ? $conditional->right->inferredType : null;
|
||||
}
|
||||
|
||||
if ($var_type) {
|
||||
|
Loading…
Reference in New Issue
Block a user