Code Duplication    Length = 10-10 lines in 2 locations

src/LTDBeget/sphinx/configurator/configurationEntities/sections/Index.php 2 locations

@@ 44-53 (lines=10) @@
41
        $source_name = NULL;
42
        $index       = $this;
43
44
        do {
45
            foreach ($index->iterateOptions() as $option) {
46
                if(eIndexOption::SOURCE()->is($option->getName()) ) {
47
                    $source_name = $option->getValue();
48
                }
49
            }
50
            if($index->isHasInheritance()) {
51
                $index = $index->getInheritance();
52
            }
53
        } while($index->isHasInheritance());
54
55
        foreach ($this->getConfiguration()->iterateSource() as $source) {
56
            if($source->getName() === $source_name) {
@@ 72-81 (lines=10) @@
69
        $isHasSource = false;
70
        $index       = $this;
71
72
        do {
73
            foreach ($index->iterateOptions() as $option) {
74
                if (eIndexOption::SOURCE()->is($option->getName())) {
75
                    $isHasSource = true;
76
                }
77
            }
78
            if ($index->isHasInheritance()) {
79
                $index = $index->getInheritance();
80
            }
81
        } while ($index->isHasInheritance());
82
83
        return $isHasSource;
84
    }