Code Duplication    Length = 9-9 lines in 2 locations

src/Repository.php 2 locations

@@ 27-35 (lines=9) @@
24
    public function create($data)
25
    {
26
        $class = Entity::class;
27
        foreach($this->space->getMapper()->getPlugins() as $plugin) {
28
            $entityClass = $plugin->getEntityClass($this->space);
29
            if($entityClass) {
30
                if($class != Entity::class) {
31
                    throw new Exception('Entity class override');
32
                }
33
                $class = $entityClass;
34
            }
35
        }
36
        $instance = new $class();
37
        foreach($this->space->getFormat() as $row) {
38
            if(array_key_exists($row['name'], $data)) {
@@ 127-135 (lines=9) @@
124
        }
125
126
        $class = Entity::class;
127
        foreach($this->space->getMapper()->getPlugins() as $plugin) {
128
            $entityClass = $plugin->getEntityClass($this->space);
129
            if($entityClass) {
130
                if($class != Entity::class) {
131
                    throw new Exception('Entity class override');
132
                }
133
                $class = $entityClass;
134
            }
135
        }
136
        $instance = new $class();
137
138
        $this->original[$key] = $tuple;