Code Duplication    Length = 11-11 lines in 2 locations

src/FeedIo/Rule/OptionalField.php 1 location

@@ 130-140 (lines=11) @@
127
    /**
128
     * @inheritDoc
129
     */
130
    protected function addElement(\DomDocument $document, \DOMElement $rootElement, NodeInterface $node) : void
131
    {
132
        $domElement = $document->createElement($this->getNodeName());
133
        if ($node instanceof ElementsAwareInterface) {
134
            foreach ($node->getElementIterator($this->getNodeName()) as $element) {
135
                $this->buildDomElement($domElement, $element);
136
            }
137
        }
138
139
        $rootElement->appendChild($domElement);
140
    }
141
}
142

src/FeedIo/Rule/Structure.php 1 location

@@ 65-75 (lines=11) @@
62
    /**
63
     * @inheritDoc
64
     */
65
    protected function addElement(\DomDocument $document, \DOMElement $rootElement, NodeInterface $node) : void
66
    {
67
        $element = $document->createElement($this->getNodeName());
68
69
        /** @var RuleAbstract $rule */
70
        foreach ($this->ruleSet->getRules() as $rule) {
71
            $rule->apply($document, $element, $node);
72
        }
73
74
        $rootElement->appendChild($element);
75
    }
76
}
77