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"));
@@ 521-528 (lines=8) @@
518
                case 'all':
519
                    $this->loadSequence($type, $childNode);
520
                    break;
521
                case 'attribute':
522
                    if ($childNode->hasAttribute("ref")) {
523
                        $attribute = $this->findSomething('findAttribute', $type->getSchema(), $node, $childNode->getAttribute("ref"));
524
                    } else {
525
                        $attribute = $this->loadAttribute($type->getSchema(), $childNode);
526
                    }
527
                    $type->addAttribute($attribute);
528
                    break;
529
                case 'attributeGroup':
530
                    $attribute = $this->findSomething('findAttributeGroup', $type->getSchema(), $node, $childNode->getAttribute("ref"));
531
                    $type->addAttribute($attribute);