Code Duplication    Length = 10-10 lines in 2 locations

src/Mapping.php 2 locations

@@ 175-184 (lines=10) @@
172
     * @return string
173
     * @throws MappingException
174
     */
175
    public function getKeyFromModel($modelName)
176
    {
177
        foreach ($this->classMetadataList as $classMetadata) {
178
            if ($modelName === $classMetadata->getModelName()) {
179
                return $classMetadata->getKey();
180
            }
181
        }
182
183
        throw new MappingException('Model name ' . $modelName . ' not found in mapping');
184
    }
185
186
    /**
187
     * getClassMetadata for model name
@@ 194-203 (lines=10) @@
191
     * @return ClassMetadata
192
     * @throws MappingException
193
     */
194
    public function getClassMetadata($modelName)
195
    {
196
        foreach ($this->classMetadataList as $classMetadata) {
197
            if ($modelName === $classMetadata->getModelName()) {
198
                return $classMetadata;
199
            }
200
        }
201
202
        throw new MappingException($modelName . ' model is not mapped');
203
    }
204
205
    /**
206
     * getClassMetadata for id