Code Duplication    Length = 9-12 lines in 5 locations

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

@@ 253-261 (lines=9) @@
250
            return true;
251
        }
252
253
        if (ClassLikeAnalyzer::checkPropertyVisibility(
254
            $property_id,
255
            $context,
256
            $statements_analyzer,
257
            new CodeLocation($statements_analyzer->getSource(), $stmt),
258
            $statements_analyzer->getSuppressedIssues()
259
        ) === false) {
260
            return false;
261
        }
262
263
        $declaring_property_class = $codebase->properties->getDeclaringClassForProperty(
264
            $fq_class_name . '::$' . $prop_name,

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

@@ 760-770 (lines=11) @@
757
                }
758
            }
759
760
            if (!$override_property_visibility) {
761
                if (ClassLikeAnalyzer::checkPropertyVisibility(
762
                    $property_id,
763
                    $context,
764
                    $statements_analyzer,
765
                    new CodeLocation($statements_analyzer->getSource(), $stmt),
766
                    $statements_analyzer->getSuppressedIssues()
767
                ) === false) {
768
                    return false;
769
                }
770
            }
771
772
            $declaring_property_class = $codebase->properties->getDeclaringClassForProperty(
773
                $property_id,

src/Psalm/Internal/Analyzer/Statements/Expression/Assignment/InstancePropertyAssignmentAnalyzer.php 2 locations

@@ 613-621 (lines=9) @@
610
611
                if (!$override_property_visibility) {
612
                    if (!$context->collect_mutations) {
613
                        if (ClassLikeAnalyzer::checkPropertyVisibility(
614
                            $property_id,
615
                            $context,
616
                            $statements_analyzer,
617
                            new CodeLocation($statements_analyzer->getSource(), $stmt),
618
                            $statements_analyzer->getSuppressedIssues()
619
                        ) === false) {
620
                            return false;
621
                        }
622
                    } else {
623
                        if (ClassLikeAnalyzer::checkPropertyVisibility(
624
                            $property_id,
@@ 622-633 (lines=12) @@
619
                        ) === false) {
620
                            return false;
621
                        }
622
                    } else {
623
                        if (ClassLikeAnalyzer::checkPropertyVisibility(
624
                            $property_id,
625
                            $context,
626
                            $statements_analyzer,
627
                            new CodeLocation($statements_analyzer->getSource(), $stmt),
628
                            $statements_analyzer->getSuppressedIssues(),
629
                            false
630
                        ) !== true) {
631
                            continue;
632
                        }
633
                    }
634
                }
635
636
                $declaring_property_class = (string) $codebase->properties->getDeclaringClassForProperty(

src/Psalm/Internal/Analyzer/Statements/Expression/Assignment/StaticPropertyAssignmentAnalyzer.php 1 location

@@ 116-124 (lines=9) @@
113
            return;
114
        }
115
116
        if (ClassLikeAnalyzer::checkPropertyVisibility(
117
            $property_id,
118
            $context,
119
            $statements_analyzer,
120
            new CodeLocation($statements_analyzer->getSource(), $stmt),
121
            $statements_analyzer->getSuppressedIssues()
122
        ) === false) {
123
            return false;
124
        }
125
126
        $declaring_property_class = (string) $codebase->properties->getDeclaringClassForProperty(
127
            $fq_class_name . '::$' . $prop_name->name,