Code Duplication    Length = 8-8 lines in 2 locations

src/SchemaReader.php 2 locations

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