Code Duplication    Length = 3-5 lines in 2 locations

src/Repository.php 2 locations

@@ 140-142 (lines=3) @@
137
138
        $this->original[$key] = $tuple;
139
140
        foreach($this->space->getFormat() as $index => $info) {
141
            $instance->{$info['name']} = array_key_exists($index, $tuple) ? $tuple[$index] : null;
142
        }
143
144
        $this->keys->offsetSet($instance, $key);
145
@@ 174-178 (lines=5) @@
171
        $client = $this->space->getMapper()->getClient();
172
        $result = $client->getSpace($this->space->getId())->update($pk, $tupleOperations);
173
        foreach($result->getData() as $tuple) {
174
            foreach($this->space->getFormat() as $index => $info) {
175
                if(array_key_exists($index, $tuple)) {
176
                    $instance->{$info['name']} = $tuple[$index];
177
                }
178
            }
179
        }
180
    }
181