Code Duplication    Length = 8-8 lines in 2 locations

src/SchemaReader.php 2 locations

@@ 92-99 (lines=8) @@
89
        return function () use ($schema, $node, $attGroup) {
90
            foreach ($node->childNodes as $childNode) {
91
                switch ($childNode->localName) {
92
                    case 'attribute':
93
                        if ($childNode->hasAttribute("ref")) {
94
                            $attribute = $this->findSomething('findAttribute', $schema, $node, $childNode->getAttribute("ref"));
95
                        } else {
96
                            $attribute = $this->loadAttribute($schema, $childNode);
97
                        }
98
                        $attGroup->addAttribute($attribute);
99
                        break;
100
                    case 'attributeGroup':
101
102
                        $attribute = $this->findSomething('findAttributeGroup', $schema, $node, $childNode->getAttribute("ref"));
@@ 529-536 (lines=8) @@
526
                case 'all':
527
                    $this->loadSequence($type, $childNode);
528
                    break;
529
                case 'attribute':
530
                    if ($childNode->hasAttribute("ref")) {
531
                        $attribute = $this->findSomething('findAttribute', $type->getSchema(), $node, $childNode->getAttribute("ref"));
532
                    } else {
533
                        $attribute = $this->loadAttribute($type->getSchema(), $childNode);
534
                    }
535
                    $type->addAttribute($attribute);
536
                    break;
537
                case 'attributeGroup':
538
                    $attribute = $this->findSomething('findAttributeGroup', $type->getSchema(), $node, $childNode->getAttribute("ref"));
539
                    $type->addAttribute($attribute);