Code Duplication    Length = 15-15 lines in 2 locations

src/Psalm/Internal/Analyzer/Statements/Expression/BinaryOp/AndAnalyzer.php 1 location

@@ 29-43 (lines=15) @@
26
        Context $context,
27
        bool $from_stmt = false
28
    ) : bool {
29
        if ($from_stmt) {
30
            $fake_if_stmt = new PhpParser\Node\Stmt\If_(
31
                $stmt->left,
32
                [
33
                    'stmts' => [
34
                        new PhpParser\Node\Stmt\Expression(
35
                            $stmt->right
36
                        )
37
                    ]
38
                ],
39
                $stmt->getAttributes()
40
            );
41
42
            return IfAnalyzer::analyze($statements_analyzer, $fake_if_stmt, $context) !== false;
43
        }
44
45
        $pre_referenced_var_ids = $context->referenced_var_ids;
46

src/Psalm/Internal/Analyzer/Statements/Expression/BinaryOp/OrAnalyzer.php 1 location

@@ 32-46 (lines=15) @@
29
        Context $context,
30
        bool $from_stmt = false
31
    ) : bool {
32
        if ($from_stmt) {
33
            $fake_if_stmt = new PhpParser\Node\Stmt\If_(
34
                new PhpParser\Node\Expr\BooleanNot($stmt->left, $stmt->left->getAttributes()),
35
                [
36
                    'stmts' => [
37
                        new PhpParser\Node\Stmt\Expression(
38
                            $stmt->right
39
                        )
40
                    ]
41
                ],
42
                $stmt->getAttributes()
43
            );
44
45
            return IfAnalyzer::analyze($statements_analyzer, $fake_if_stmt, $context) !== false;
46
        }
47
48
        $codebase = $statements_analyzer->getCodebase();
49