Code Duplication    Length = 16-16 lines in 2 locations

src/SchemaReader.php 2 locations

@@ 590-605 (lines=16) @@
587
                case 'restriction':
588
                    $this->loadRestriction($type, $childNode);
589
                    break;
590
                case 'extension':
591
                    if (! ($type instanceof BaseComplexType)) {
592
                        throw new RuntimeException(
593
                            'Argument 1 passed to ' .
594
                            __METHOD__ .
595
                            ' needs to be an instance of ' .
596
                            BaseComplexType::class .
597
                            ' when passed onto ' .
598
                            static::class .
599
                            '::loadExtension(), ' .
600
                            get_class($type) .
601
                            ' given.'
602
                        );
603
                    }
604
                    $this->loadExtension($type, $childNode);
605
                    break;
606
                case 'simpleContent':
607
                case 'complexContent':
608
                    $this->fillTypeNode($type, $childNode, false);
@@ 631-646 (lines=16) @@
628
            switch ($childNode->localName) {
629
                case 'sequence':
630
                case 'choice':
631
                case 'all':
632
                    if (! ($type instanceof ElementContainer)) {
633
                        throw new RuntimeException(
634
                            'Argument 1 passed to ' .
635
                            __METHOD__ .
636
                            ' needs to be an instance of ' .
637
                            ElementContainer::class .
638
                            ' when passed onto ' .
639
                            static::class .
640
                            '::loadSequence(), ' .
641
                            get_class($type) .
642
                            ' given.'
643
                        );
644
                    }
645
                    $this->loadSequence($type, $childNode);
646
                    break;
647
                case 'attribute':
648
                    if ($childNode->hasAttribute("ref")) {
649
                        /**