Code Duplication    Length = 6-6 lines in 2 locations

src/Util/EntityUtility.php 2 locations

@@ 206-211 (lines=6) @@
203
                throw MetadataException::invalidMetadata($metadata->type, sprintf('The data type "%s" for attribute "%s" is invalid', $attribute->dataType, $attribute->key));
204
            }
205
206
            if (true === $metadata->isChildEntity()) {
207
                $parent = $mf->getMetadataForType($metadata->extends);
208
                if ($parent->hasAttribute($attribute->key)) {
209
                    throw MetadataException::invalidMetadata($metadata->type, sprintf('Parent entity type "%s" already contains attribute field "%s"', $parent->type, $attribute->key));
210
                }
211
            }
212
213
            if (true === $attribute->isCalculated()) {
214
                if (false === class_exists($attribute->calculated['class']) || false === method_exists($attribute->calculated['class'], $attribute->calculated['method'])) {
@@ 239-244 (lines=6) @@
236
            if (false === $this->isFieldKeyValid($relationship->key)) {
237
                throw MetadataException::invalidMetadata($metadata->type, sprintf('The relationship key "%s" is invalid based on the configured name format "%s"', $relationship->key, $this->config->getFieldKeyFormat()));
238
            }
239
            if (true === $metadata->isChildEntity()) {
240
                $parent = $mf->getMetadataForType($metadata->extends);
241
                if ($parent->hasRelationship($relationship->key)) {
242
                    throw MetadataException::invalidMetadata($metadata->type, sprintf('Parent entity type "%s" already contains relationship field "%s"', $parent->type, $relationship->key));
243
                }
244
            }
245
            if (false === $this->isEntityTypeValid($relationship->entityType)) {
246
                throw MetadataException::invalidMetadata($metadata->type, sprintf('The related model "%s" for relationship "%s" is invalid based on the configured name format "%s"', $relationship->entityType, $relationship->key, $this->config->getEntityFormat()));
247
            }