Code Duplication    Length = 16-18 lines in 2 locations

src/SchemaReader.php 2 locations

@@ 276-293 (lines=18) @@
273
    /**
274
    * @return ElementRef
275
    */
276
    private function loadElementRef(ElementDef $referenced, DOMElement $node)
277
    {
278
        $ref = new ElementRef($referenced);
279
        $this->setDoc($ref, $node);
280
281
        static::maybeSetMax($ref, $node);
282
        if ($node->hasAttribute("minOccurs")) {
283
            $ref->setMin((int)$node->getAttribute("minOccurs"));
284
        }
285
        if ($node->hasAttribute("nillable")) {
286
            $ref->setNil($node->getAttribute("nillable") == "true");
287
        }
288
        if ($node->hasAttribute("form")) {
289
            $ref->setQualified($node->getAttribute("form") == "qualified");
290
        }
291
292
        return $ref;
293
    }
294
295
    private function setDoc(Item $ref, DOMElement $node)
296
    {
@@ 312-327 (lines=16) @@
309
    /**
310
    * @return AttributeRef
311
    */
312
    private function loadAttributeRef(AttributeDef $referencedAttribiute, DOMElement $node)
313
    {
314
        $attribute = new AttributeRef($referencedAttribiute);
315
        $this->setDoc($attribute, $node);
316
317
        if ($node->hasAttribute("nillable")) {
318
            $attribute->setNil($node->getAttribute("nillable") == "true");
319
        }
320
        if ($node->hasAttribute("form")) {
321
            $attribute->setQualified($node->getAttribute("form") == "qualified");
322
        }
323
        if ($node->hasAttribute("use")) {
324
            $attribute->setUse($node->getAttribute("use"));
325
        }
326
        return $attribute;
327
    }
328
329
    /**
330
    * @param int|null $max