Code Duplication    Length = 16-16 lines in 2 locations

src/Configuration/Loader/Xml.php 2 locations

@@ 282-297 (lines=16) @@
279
     * @param  \DOMElement                     $node
280
     * @throws \phpbu\App\Exception
281
     */
282
    protected function setCrypt(Configuration\Backup $backup, DOMElement $node)
283
    {
284
        /** @var \DOMNodeList $cryptNodes */
285
        $cryptNodes = $node->getElementsByTagName('crypt');
286
        if ($cryptNodes->length > 0) {
287
            /** @var \DOMElement $cryptNode */
288
            $cryptNode = $cryptNodes->item(0);
289
            $type = $cryptNode->getAttribute('type');
290
            if (!$type) {
291
                throw new Exception('invalid crypt configuration: attribute type missing');
292
            }
293
            $skip    = Str::toBoolean($cryptNode->getAttribute('skipOnFailure'), true);
294
            $options = $this->getOptions($cryptNode);
295
            $backup->setCrypt(new Configuration\Backup\Crypt($type, $skip, $options));
296
        }
297
    }
298
299
    /**
300
     * Set backup sync configurations.
@@ 327-342 (lines=16) @@
324
     * @param  \DOMElement                     $node
325
     * @throws \phpbu\App\Exception
326
     */
327
    protected function setCleanup(Configuration\Backup $backup, DOMElement $node)
328
    {
329
        /** @var \DOMNodeList $cleanupNodes */
330
        $cleanupNodes = $node->getElementsByTagName('cleanup');
331
        if ($cleanupNodes->length > 0) {
332
            /** @var \DOMElement $cleanupNode */
333
            $cleanupNode = $cleanupNodes->item(0);
334
            $type        = $cleanupNode->getAttribute('type');
335
            if (!$type) {
336
                throw new Exception('invalid cleanup configuration: attribute type missing');
337
            }
338
            $skip    = Str::toBoolean($cleanupNode->getAttribute('skipOnFailure'), true);
339
            $options = $this->getOptions($cleanupNode);
340
            $backup->setCleanup(new Configuration\Backup\Cleanup($type, $skip, $options));
341
        }
342
    }
343
344
    /**
345
     * Extracts all option tags.