Code Duplication    Length = 11-11 lines in 2 locations

src/FeedIo/Rule/OptionalField.php 1 location

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

src/FeedIo/Rule/Structure.php 1 location

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