Code Duplication    Length = 10-14 lines in 4 locations

src/Psalm/Internal/Codebase/Reflection.php 3 locations

@@ 468-477 (lines=10) @@
465
        $storage = $this->storage_provider->get($fq_class_name);
466
467
        // register where they appear (can never be in a trait)
468
        foreach ($parent_storage->appearing_property_ids as $property_name => $appearing_property_id) {
469
            if (!$parent_storage->is_trait
470
                && isset($parent_storage->properties[$property_name])
471
                && $parent_storage->properties[$property_name]->visibility === ClassLikeAnalyzer::VISIBILITY_PRIVATE
472
            ) {
473
                continue;
474
            }
475
476
            $storage->appearing_property_ids[$property_name] = $appearing_property_id;
477
        }
478
479
        // register where they're declared
480
        foreach ($parent_storage->declaring_property_ids as $property_name => $declaring_property_class) {
@@ 480-489 (lines=10) @@
477
        }
478
479
        // register where they're declared
480
        foreach ($parent_storage->declaring_property_ids as $property_name => $declaring_property_class) {
481
            if (!$parent_storage->is_trait
482
                && isset($parent_storage->properties[$property_name])
483
                && $parent_storage->properties[$property_name]->visibility === ClassLikeAnalyzer::VISIBILITY_PRIVATE
484
            ) {
485
                continue;
486
            }
487
488
            $storage->declaring_property_ids[$property_name] = strtolower($declaring_property_class);
489
        }
490
491
        // register where they're declared
492
        foreach ($parent_storage->inheritable_property_ids as $property_name => $inheritable_property_id) {
@@ 492-501 (lines=10) @@
489
        }
490
491
        // register where they're declared
492
        foreach ($parent_storage->inheritable_property_ids as $property_name => $inheritable_property_id) {
493
            if (!$parent_storage->is_trait
494
                && isset($parent_storage->properties[$property_name])
495
                && $parent_storage->properties[$property_name]->visibility === ClassLikeAnalyzer::VISIBILITY_PRIVATE
496
            ) {
497
                continue;
498
            }
499
500
            $storage->inheritable_property_ids[$property_name] = $inheritable_property_id;
501
        }
502
    }
503
504
    /**

src/Psalm/Internal/Codebase/Populator.php 1 location

@@ 1223-1236 (lines=14) @@
1220
        }
1221
1222
        // register where they're declared
1223
        foreach ($parent_storage->declaring_property_ids as $property_name => $declaring_property_class) {
1224
            if (isset($storage->declaring_property_ids[$property_name])) {
1225
                continue;
1226
            }
1227
1228
            if (!$parent_storage->is_trait
1229
                && isset($parent_storage->properties[$property_name])
1230
                && $parent_storage->properties[$property_name]->visibility === ClassLikeAnalyzer::VISIBILITY_PRIVATE
1231
            ) {
1232
                continue;
1233
            }
1234
1235
            $storage->declaring_property_ids[$property_name] = $declaring_property_class;
1236
        }
1237
1238
        // register where they're declared
1239
        foreach ($parent_storage->inheritable_property_ids as $property_name => $inheritable_property_id) {