Code Duplication    Length = 18-18 lines in 2 locations

Faker/Provider/XmlText.php 1 location

@@ 184-201 (lines=18) @@
181
        $this->wrapInParagraph($node, $element);
182
    }
183
184
    private function addRandomTable(\DOMElement $element, $maxRows = 10, $maxCols = 6, $maxLength = 10)
185
    {
186
        $rows = mt_rand(1, $maxRows);
187
        $cols = mt_rand(1, $maxCols);
188
189
        $table = $element->ownerDocument->createElement(static::TABLE_TAG);
190
191
        for ($i = 0; $i < $rows; $i++) {
192
            $tr = $element->ownerDocument->createElement(static::TR_TAG);
193
            $table->appendChild($tr);
194
            for ($j = 0; $j < $cols; $j++) {
195
                $th = $element->ownerDocument->createElement(static::TD_TAG);
196
                $th->textContent = $this->getSentence(mt_rand(1, $maxLength));
197
                $tr->appendChild($th);
198
            }
199
        }
200
        $this->wrapInParagraph($table, $element);
201
    }
202
203
    private function addRandomUL(\DOMElement $element, $maxItems = 11, $maxLength = 4)
204
    {

Faker/Provider/RichText.php 1 location

@@ 179-196 (lines=18) @@
176
        $this->wrapInParagraph($node, $element);
177
    }
178
179
    private function addRandomTable(\DOMElement $element, $maxRows = 10, $maxCols = 6, $maxLength = 10)
180
    {
181
        $rows = mt_rand(1, $maxRows);
182
        $cols = mt_rand(1, $maxCols);
183
184
        $table = $element->ownerDocument->createElement(static::TABLE_TAG);
185
186
        for ($i = 0; $i < $rows; $i++) {
187
            $tr = $element->ownerDocument->createElement(static::TR_TAG);
188
            $table->appendChild($tr);
189
            for ($j = 0; $j < $cols; $j++) {
190
                $th = $element->ownerDocument->createElement(static::TD_TAG);
191
                $th->textContent = $this->getSentence(mt_rand(1, $maxLength));
192
                $tr->appendChild($th);
193
            }
194
        }
195
        $this->wrapInParagraph($table, $element);
196
    }
197
198
    private function addRandomUL(\DOMElement $element, $maxItems = 11, $maxLength = 4)
199
    {