Code Duplication    Length = 8-8 lines in 2 locations

src/SchemaReader.php 2 locations

@@ 71-78 (lines=8) @@
68
        return function () use ($schema, $node, $attGroup) {
69
            foreach ($node->childNodes as $childNode) {
70
                switch ($childNode->localName) {
71
                    case 'attribute':
72
                        if ($childNode->hasAttribute("ref")) {
73
                            $attribute = $this->findSomething('findAttribute', $schema, $node, $childNode->getAttribute("ref"));
74
                        } else {
75
                            $attribute = $this->loadAttribute($schema, $childNode);
76
                        }
77
                        $attGroup->addAttribute($attribute);
78
                        break;
79
                    case 'attributeGroup':
80
81
                        $attribute = $this->findSomething('findAttributeGroup', $schema, $node, $childNode->getAttribute("ref"));
@@ 495-502 (lines=8) @@
492
                case 'all':
493
                    $this->loadSequence($type, $childNode);
494
                    break;
495
                case 'attribute':
496
                    if ($childNode->hasAttribute("ref")) {
497
                        $attribute = $this->findSomething('findAttribute', $type->getSchema(), $node, $childNode->getAttribute("ref"));
498
                    } else {
499
                        $attribute = $this->loadAttribute($type->getSchema(), $childNode);
500
                    }
501
                    $type->addAttribute($attribute);
502
                    break;
503
                case 'attributeGroup':
504
                    $attribute = $this->findSomething('findAttributeGroup', $type->getSchema(), $node, $childNode->getAttribute("ref"));
505
                    $type->addAttribute($attribute);