Code Duplication    Length = 9-9 lines in 2 locations

src/Repository.php 2 locations

@@ 29-37 (lines=9) @@
26
    {
27
        $data = (array) $data;
28
        $class = Entity::class;
29
        foreach ($this->getMapper()->getPlugins() as $plugin) {
30
            $entityClass = $plugin->getEntityClass($this->space);
31
            if ($entityClass) {
32
                if ($class != Entity::class) {
33
                    throw new Exception('Entity class override');
34
                }
35
                $class = $entityClass;
36
            }
37
        }
38
39
        if (array_key_exists(0, $data)) {
40
            $byType = [];
@@ 231-239 (lines=9) @@
228
        }
229
230
        $class = Entity::class;
231
        foreach ($this->getMapper()->getPlugins() as $plugin) {
232
            $entityClass = $plugin->getEntityClass($this->space);
233
            if ($entityClass) {
234
                if ($class != Entity::class) {
235
                    throw new Exception('Entity class override');
236
                }
237
                $class = $entityClass;
238
            }
239
        }
240
241
        $instance = new $class($this);
242