Code Duplication    Length = 8-8 lines in 2 locations

model/Concept.php 2 locations

@@ 556-563 (lines=8) @@
553
    public function getForeignLabels()
554
    {
555
        $labels = array();
556
        foreach ($this->resource->allLiterals('skos:prefLabel') as $lit) {
557
            // filtering away subsets of the current language eg. en vs en-GB
558
            if ($lit->getLang() != $this->clang && strpos($lit->getLang(), $this->getEnvLang() . '-') !== 0) {
559
                $langName = Punic\Language::getName($lit->getLang(), $this->getEnvLang()) !== $lit->getLang() ? Punic\Language::getName($lit->getLang(), $this->getEnvLang()) : gettext($lit->getLang());
560
                $labels[$langName][] = new ConceptPropertyValueLiteral($lit, 'skos:prefLabel');
561
            }
562
563
        }
564
        foreach ($this->resource->allLiterals('skos:altLabel') as $lit) {
565
            // filtering away subsets of the current language eg. en vs en-GB
566
            if ($lit->getLang() != $this->clang && strpos($lit->getLang(), $this->getEnvLang() . '-') !== 0) {
@@ 564-571 (lines=8) @@
561
            }
562
563
        }
564
        foreach ($this->resource->allLiterals('skos:altLabel') as $lit) {
565
            // filtering away subsets of the current language eg. en vs en-GB
566
            if ($lit->getLang() != $this->clang && strpos($lit->getLang(), $this->getEnvLang() . '-') !== 0) {
567
                $langName = Punic\Language::getName($lit->getLang(), $this->getEnvLang()) ? Punic\Language::getName($lit->getLang(), $this->getEnvLang()) : gettext($lit->getLang());
568
                $labels[$langName][] = new ConceptPropertyValueLiteral($lit, 'skos:altLabel');
569
            }
570
571
        }
572
        ksort($labels);
573
        return $labels;
574
    }