Code Duplication    Length = 34-35 lines in 2 locations

src/SchemaReader.php 2 locations

@@ 141-174 (lines=34) @@
138
    /**
139
     * @param int|null $max
140
     */
141
    private function loadSequenceChildNode(
142
        ElementContainer $elementContainer,
143
        DOMElement $node,
144
        DOMElement $childNode,
145
        $max
146
    ) {
147
        switch ($childNode->localName) {
148
            case 'sequence':
149
            case 'choice':
150
            case 'all':
151
                $this->loadSequence(
152
                    $elementContainer,
153
                    $childNode,
154
                    $max
155
                );
156
                break;
157
            case 'element':
158
                $this->loadSequenceChildNodeLoadElement(
159
                    $elementContainer,
160
                    $node,
161
                    $childNode,
162
                    $max
163
                );
164
                break;
165
            case 'group':
166
                $this->addGroupAsElement(
167
                    $elementContainer->getSchema(),
168
                    $node,
169
                    $childNode,
170
                    $elementContainer
171
                );
172
                break;
173
        }
174
    }
175
176
    /**
177
     * @param int|null $max
@@ 519-553 (lines=35) @@
516
    ) {
517
        static::againstDOMNodeList(
518
            $node,
519
            function (
520
                DOMElement $node,
521
                DOMElement $childNode
522
            ) use (
523
                $type
524
            ) {
525
                switch ($childNode->localName) {
526
                    case 'sequence':
527
                    case 'choice':
528
                    case 'all':
529
                        if ($type instanceof ElementContainer) {
530
                            $this->loadSequence(
531
                                $type,
532
                                $childNode
533
                            );
534
                        }
535
                        break;
536
                    case 'attribute':
537
                        $this->addAttributeFromAttributeOrRef(
538
                            $type,
539
                            $childNode,
540
                            $type->getSchema(),
541
                            $node
542
                        );
543
                        break;
544
                    case 'attributeGroup':
545
                        $this->findSomethingLikeAttributeGroup(
546
                            $type->getSchema(),
547
                            $node,
548
                            $childNode,
549
                            $type
550
                        );
551
                        break;
552
                }
553
            }
554
        );
555
    }
556