Code Duplication    Length = 10-12 lines in 2 locations

src/Generator.php 2 locations

@@ 148-159 (lines=12) @@
145
    /**
146
     * @param Category $category
147
     */
148
    protected function addCategory(Category $category)
149
    {
150
        $this->writer->startElement('category');
151
        $this->writer->writeAttribute('id', $category->getId());
152
153
        if ($category->getParentId() !== null) {
154
            $this->writer->writeAttribute('parentId', $category->getParentId());
155
        }
156
157
        $this->writer->text($category->getName());
158
        $this->writer->fullEndElement();
159
    }
160
161
    /**
162
     * @param Delivery $delivery
@@ 164-173 (lines=10) @@
161
    /**
162
     * @param Delivery $delivery
163
     */
164
    protected function addDelivery(Delivery $delivery)
165
    {
166
        $this->writer->startElement('option');
167
        $this->writer->writeAttribute('cost', $delivery->getCost());
168
        $this->writer->writeAttribute('days', $delivery->getDays());
169
        if ($delivery->getOrderBefore() !== null) {
170
            $this->writer->writeAttribute('order-before', $delivery->getOrderBefore());
171
        }
172
        $this->writer->endElement();
173
    }
174
175
    /**
176
     * @param OfferInterface $offer