Code Duplication    Length = 10-10 lines in 2 locations

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

src/Controller/Taxon/ShowTaxonTreeAction.php 1 location

@@ 68-77 (lines=10) @@
65
        return $this->viewHandler->handle(View::create($taxonViews, Response::HTTP_OK));
66
    }
67
68
    private function buildTaxonView(TaxonInterface $taxon, $locale): TaxonView
69
    {
70
        $taxonView = $this->taxonViewFactory->create($taxon, $locale);
71
72
        foreach ($taxon->getChildren() as $childTaxon) {
73
            $taxonView->children[] = $this->buildTaxonView($childTaxon, $locale);
74
        }
75
76
        return $taxonView;
77
    }
78
}
79