Code Duplication    Length = 10-10 lines in 2 locations

src/Controller/Taxon/ShowTaxonTreeAction.php 1 location

@@ 61-70 (lines=10) @@
58
        return $this->viewHandler->handle(View::create($taxonViews, Response::HTTP_OK));
59
    }
60
61
    private function buildTaxonView(TaxonInterface $taxon, $locale): TaxonView
62
    {
63
        $taxonView = $this->taxonViewFactory->create($taxon, $locale);
64
65
        foreach ($taxon->getChildren() as $childTaxon) {
66
            $taxonView->children[] = $this->buildTaxonView($childTaxon, $locale);
67
        }
68
69
        return $taxonView;
70
    }
71
}
72

src/Factory/TaxonDetailsViewFactory.php 1 location

@@ 48-57 (lines=10) @@
45
        return $currentTaxonView;
46
    }
47
48
    private function buildTaxonView(TaxonInterface $taxon, $locale): TaxonView
49
    {
50
        $taxonView = $this->taxonViewFactory->create($taxon, $locale);
51
52
        foreach ($taxon->getChildren() as $childTaxon) {
53
            $taxonView->children[] = $this->buildTaxonView($childTaxon, $locale);
54
        }
55
56
        return $taxonView;
57
    }
58
}
59