Code Duplication    Length = 17-19 lines in 2 locations

src/SchemaReaderCallbackAbstraction.php 2 locations

@@ 75-91 (lines=17) @@
72
        }
73
    }
74
75
    protected function maybeLoadSequenceFromElementContainer(
76
        BaseComplexType $type,
77
        DOMElement $childNode
78
    ) : void {
79
        if (! ($type instanceof ElementContainer)) {
80
            throw new RuntimeException(
81
                '$type passed to ' .
82
                __FUNCTION__ .
83
                'expected to be an instance of ' .
84
                ElementContainer::class .
85
                ' when child node localName is "group", ' .
86
                get_class($type) .
87
                ' given.'
88
            );
89
        }
90
        $this->loadSequence($type, $childNode);
91
    }
92
93
    protected function makeCallbackCallback(
94
        Type $type,
@@ 137-155 (lines=19) @@
134
        }
135
    }
136
137
    protected function maybeLoadExtensionFromBaseComplexType(
138
        Type $type,
139
        DOMElement $childNode
140
    ) : void {
141
        if (! ($type instanceof BaseComplexType)) {
142
            throw new RuntimeException(
143
                'Argument 1 passed to ' .
144
                __METHOD__ .
145
                ' needs to be an instance of ' .
146
                BaseComplexType::class .
147
                ' when passed onto ' .
148
                static::class .
149
                '::loadExtension(), ' .
150
                get_class($type) .
151
                ' given.'
152
            );
153
        }
154
        $this->loadExtension($type, $childNode);
155
    }
156
}
157