Code Duplication    Length = 3-3 lines in 3 locations

src/Util/EntityUtility.php 3 locations

@@ 132-134 (lines=3) @@
129
                throw MetadataException::invalidMetadata($metadata->type, sprintf('Child class types must be prefixed by the parent class. Expected "%s" prefix.', $parentType));
130
            }
131
        }
132
        if (false === $this->isEntityTypeValid($metadata->type)) {
133
            throw MetadataException::invalidMetadata($metadata->type, sprintf('The entity type is invalid based on the configured name format "%s"', $this->config->getEntityFormat()));
134
        }
135
        return true;
136
    }
137
@@ 151-153 (lines=3) @@
148
        if (true === $metadata->isPolymorphic()) {
149
            foreach ($metadata->ownedTypes as $child) {
150
151
                if (false === $this->isEntityTypeValid($child)) {
152
                    throw MetadataException::invalidMetadata($metadata->type, sprintf('The owned entity type "%s" is invalid based on the configured name format "%s"', $child, $this->config->getEntityFormat()));
153
                }
154
155
                if (false === $mf->metadataExists($child)) {
156
                    throw MetadataException::invalidMetadata($metadata->type, sprintf('The entity owns a type "%s" that does not exist.', $child));
@@ 266-268 (lines=3) @@
263
                    throw MetadataException::invalidMetadata($metadata->type, sprintf('Parent entity type "%s" already contains relationship field "%s"', $parent->type, $relationship->key));
264
                }
265
            }
266
            if (false === $this->isEntityTypeValid($relationship->entityType)) {
267
                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()));
268
            }
269
            if (false === $mf->metadataExists($relationship->entityType)) {
270
                throw MetadataException::invalidMetadata($metadata->type, sprintf('The related model "%s" for relationship "%s" does not exist.', $relationship->entityType, $relationship->key));
271
            }