Code Duplication    Length = 34-35 lines in 2 locations

src/SchemaReader.php 2 locations

@@ 327-360 (lines=34) @@
324
    /**
325
     * @param int|null $max
326
     */
327
    private function loadSequenceChildNode(
328
        ElementContainer $elementContainer,
329
        DOMElement $node,
330
        DOMElement $childNode,
331
        $max
332
    ) {
333
        switch ($childNode->localName) {
334
            case 'sequence':
335
            case 'choice':
336
            case 'all':
337
                $this->loadSequence(
338
                    $elementContainer,
339
                    $childNode,
340
                    $max
341
                );
342
                break;
343
            case 'element':
344
                $this->loadSequenceChildNodeLoadElement(
345
                    $elementContainer,
346
                    $node,
347
                    $childNode,
348
                    $max
349
                );
350
                break;
351
            case 'group':
352
                $this->addGroupAsElement(
353
                    $elementContainer->getSchema(),
354
                    $node,
355
                    $childNode,
356
                    $elementContainer
357
                );
358
                break;
359
        }
360
    }
361
362
    /**
363
     * @param int|null $max
@@ 744-778 (lines=35) @@
741
    ) {
742
        static::againstDOMNodeList(
743
            $node,
744
            function (
745
                DOMElement $node,
746
                DOMElement $childNode
747
            ) use (
748
                $type
749
            ) {
750
                switch ($childNode->localName) {
751
                    case 'sequence':
752
                    case 'choice':
753
                    case 'all':
754
                        if ($type instanceof ElementContainer) {
755
                            $this->loadSequence(
756
                                $type,
757
                                $childNode
758
                            );
759
                        }
760
                        break;
761
                    case 'attribute':
762
                        $this->addAttributeFromAttributeOrRef(
763
                            $type,
764
                            $childNode,
765
                            $type->getSchema(),
766
                            $node
767
                        );
768
                        break;
769
                    case 'attributeGroup':
770
                        $this->findSomethingLikeAttributeGroup(
771
                            $type->getSchema(),
772
                            $node,
773
                            $childNode,
774
                            $type
775
                        );
776
                        break;
777
                }
778
            }
779
        );
780
    }
781