Code Duplication    Length = 17-18 lines in 2 locations

eZ/Publish/Core/Persistence/Legacy/Content/FieldValue/Converter/PageConverter.php 2 locations

@@ 359-376 (lines=18) @@
356
            $dom->loadXML($xmlString);
357
            $root = $dom->documentElement;
358
359
            foreach ($root->childNodes as $node) {
360
                if ($node->nodeType !== XML_ELEMENT_NODE) {
361
                    continue;
362
                }
363
364
                switch ($node->nodeName) {
365
                    case 'zone':
366
                        $zone = $this->restoreZoneFromXml($node);
367
                        $zones[] = $zone;
368
                        break;
369
                    case 'zone_layout':
370
                        $layout = $node->nodeValue;
371
                        break;
372
                    default:
373
                        $attributes[$node->nodeName] = $node->nodeValue;
374
                        break;
375
                }
376
            }
377
378
            if ($root->hasAttributes()) {
379
                foreach ($root->attributes as $attr) {
@@ 428-444 (lines=17) @@
425
            }
426
        }
427
428
        foreach ($node->childNodes as $node) {
429
            if ($node->nodeType !== XML_ELEMENT_NODE) {
430
                continue;
431
            }
432
433
            switch ($node->nodeName) {
434
                case 'block':
435
                    $block = $this->restoreBlockFromXml($node);
436
                    $blocks[] = $block;
437
                    break;
438
                case 'zone_identifier':
439
                    $zoneIdentifier = $node->nodeValue;
440
                    break;
441
                default:
442
                    $attributes[$node->nodeName] = $node->nodeValue;
443
            }
444
        }
445
446
        return new Parts\Zone(
447
            [