Code Duplication    Length = 10-10 lines in 2 locations

src/Mapping.php 2 locations

@@ 164-173 (lines=10) @@
161
     * @return string
162
     * @throws MappingException
163
     */
164
    public function getKeyFromModel($modelName)
165
    {
166
        foreach ($this->classMetadatas as $classMetadata) {
167
            if ($modelName === $classMetadata->getModelName()) {
168
                return $classMetadata->getKey();
169
            }
170
        }
171
172
        throw new MappingException('Model name ' . $modelName . ' not found in mapping');
173
    }
174
175
    /**
176
     * getClassMetadata for model name
@@ 183-192 (lines=10) @@
180
     * @return ClassMetadata
181
     * @throws MappingException
182
     */
183
    public function getClassMetadata($modelName)
184
    {
185
        foreach ($this->classMetadatas as $classMetadata) {
186
            if ($modelName === $classMetadata->getModelName()) {
187
                return $classMetadata;
188
            }
189
        }
190
191
        throw new MappingException($modelName . ' model is not mapped');
192
    }
193
194
    /**
195
     * getClassMetadata for model short name