Code Duplication    Length = 8-9 lines in 2 locations

Stanza/Message.php 1 location

@@ 50-57 (lines=8) @@
47
        $body->setContent($content);
48
    }
49
50
    private function bodyPredicate($language) {
51
        $predicate = name('body');
52
        if($language !== null) {
53
            $predicate = all($predicate, attribute('lang', $language, XmlElement::XML));
54
        }
55
56
        return $predicate;
57
    }
58
}

Xml/XmlElement.php 1 location

@@ 459-467 (lines=9) @@
456
     *
457
     * @return XmlElement[] Found Elements
458
     */
459
    public function elements($name, $uri = null) : array
460
    {
461
        $predicate = filter\element\name($name);
462
        if ($uri !== null) {
463
            $predicate = filter\all($predicate, filter\element\xmlns($uri));
464
        }
465
466
        return $this->all($predicate);
467
    }
468
469
    /**
470
     * Filters element with given predicate