Code Duplication    Length = 34-35 lines in 2 locations

src/SchemaReader.php 2 locations

@@ 371-404 (lines=34) @@
368
    /**
369
     * @param int|null $max
370
     */
371
    private function loadSequenceChildNode(
372
        ElementContainer $elementContainer,
373
        DOMElement $node,
374
        DOMElement $childNode,
375
        $max
376
    ) {
377
        switch ($childNode->localName) {
378
            case 'sequence':
379
            case 'choice':
380
            case 'all':
381
                $this->loadSequence(
382
                    $elementContainer,
383
                    $childNode,
384
                    $max
385
                );
386
                break;
387
            case 'element':
388
                $this->loadSequenceChildNodeLoadElement(
389
                    $elementContainer,
390
                    $node,
391
                    $childNode,
392
                    $max
393
                );
394
                break;
395
            case 'group':
396
                $this->addGroupAsElement(
397
                    $elementContainer->getSchema(),
398
                    $node,
399
                    $childNode,
400
                    $elementContainer
401
                );
402
                break;
403
        }
404
    }
405
406
    /**
407
     * @param int|null $max
@@ 824-858 (lines=35) @@
821
    ) {
822
        static::againstDOMNodeList(
823
            $node,
824
            function (
825
                DOMElement $node,
826
                DOMElement $childNode
827
            ) use (
828
                $type
829
            ) {
830
                switch ($childNode->localName) {
831
                    case 'sequence':
832
                    case 'choice':
833
                    case 'all':
834
                        if ($type instanceof ElementContainer) {
835
                            $this->loadSequence(
836
                                $type,
837
                                $childNode
838
                            );
839
                        }
840
                        break;
841
                    case 'attribute':
842
                        $this->addAttributeFromAttributeOrRef(
843
                            $type,
844
                            $childNode,
845
                            $type->getSchema(),
846
                            $node
847
                        );
848
                        break;
849
                    case 'attributeGroup':
850
                        $this->findSomethingLikeAttributeGroup(
851
                            $type->getSchema(),
852
                            $node,
853
                            $childNode,
854
                            $type
855
                        );
856
                        break;
857
                }
858
            }
859
        );
860
    }
861