Code Duplication    Length = 5-8 lines in 2 locations

src/Psalm/Internal/Analyzer/Statements/Expression/Fetch/InstancePropertyFetchAnalyzer.php 1 location

@@ 929-936 (lines=8) @@
926
                $in_assignment
927
            );
928
929
            if ($stmt_type = $statements_analyzer->node_data->getType($stmt)) {
930
                $statements_analyzer->node_data->setType(
931
                    $stmt,
932
                    Type::combineUnionTypes($class_property_type, $stmt_type)
933
                );
934
            } else {
935
                $statements_analyzer->node_data->setType($stmt, $class_property_type);
936
            }
937
        }
938
939
        $stmt_type = $statements_analyzer->node_data->getType($stmt);

src/Psalm/Internal/Analyzer/Statements/Expression/TernaryAnalyzer.php 1 location

@@ 261-265 (lines=5) @@
258
            $lhs_type = $if_return_type_reconciled;
259
        }
260
261
        if ($lhs_type && ($stmt_else_type = $statements_analyzer->node_data->getType($stmt->else))) {
262
            $statements_analyzer->node_data->setType($stmt, Type::combineUnionTypes($lhs_type, $stmt_else_type));
263
        } else {
264
            $statements_analyzer->node_data->setType($stmt, Type::getMixed());
265
        }
266
267
        return true;
268
    }