Code Duplication    Length = 8-10 lines in 2 locations

class/ExtcalPersistableObjectHandler.php 2 locations

@@ 167-176 (lines=10) @@
164
            $obj = $this->create(false);
165
            $obj->assignVars($myrow);
166
            if (!$idAsKey) {
167
                if ($asObject) {
168
                    $ret[] = $obj;
169
                } else {
170
                    $row  = [];
171
                    $vars =& $obj->getVars();
172
                    foreach (array_keys($vars) as $i) {
173
                        $row[$i] = $obj->getVar($i);
174
                    }
175
                    $ret[] = $row;
176
                }
177
            } else {
178
                if ($asObject) {
179
                    $ret[$myrow[$this->keyName]] = $obj;
@@ 180-187 (lines=8) @@
177
            } else {
178
                if ($asObject) {
179
                    $ret[$myrow[$this->keyName]] = $obj;
180
                } else {
181
                    $row  = [];
182
                    $vars =& $obj->getVars();
183
                    foreach (array_keys($vars) as $i) {
184
                        $row[$i] = $obj->getVar($i);
185
                    }
186
                    $ret[$myrow[$this->keyName]] = $row;
187
                }
188
            }
189
            unset($obj);
190
        }