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
        $ref->setDoc($this->getDocumentation($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 static function maybeSetMax(InterfaceSetMinMax $ref, DOMElement $node)
296
    {
@@ 307-322 (lines=16) @@
304
    /**
305
    * @return AttributeRef
306
    */
307
    private function loadAttributeRef(AttributeDef $referencedAttribiute, DOMElement $node)
308
    {
309
        $attribute = new AttributeRef($referencedAttribiute);
310
        $attribute->setDoc($this->getDocumentation($node));
311
312
        if ($node->hasAttribute("nillable")) {
313
            $attribute->setNil($node->getAttribute("nillable") == "true");
314
        }
315
        if ($node->hasAttribute("form")) {
316
            $attribute->setQualified($node->getAttribute("form") == "qualified");
317
        }
318
        if ($node->hasAttribute("use")) {
319
            $attribute->setUse($node->getAttribute("use"));
320
        }
321
        return $attribute;
322
    }
323
324
    /**
325
    * @param int|null $max