Code Duplication    Length = 3-3 lines in 2 locations

src/ShapeFile.php 2 locations

@@ 260-262 (lines=3) @@
257
      if (file_exists(str_replace('.*', '.dbf', $this->FileName))) {
258
        @unlink(str_replace('.*', '.dbf', $this->FileName));
259
      }
260
      if (!($this->DBFFile = @dbase_create(str_replace('.*', '.dbf', $this->FileName), $this->DBFHeader))) {
261
        return $this->setError(sprintf("It wasn't possible to create the DBase file '%s'", str_replace('.*', '.dbf', $this->FileName)));
262
      }
263
264
      $offset = 50;
265
      if (is_array($this->records) && (count($this->records) > 0)) {
@@ 315-317 (lines=3) @@
312
    function _openDBFFile($toWrite = false) {
313
      $checkFunction = $toWrite ? "is_writable" : "is_readable";
314
      if (($toWrite) && (!file_exists(str_replace('.*', '.dbf', $this->FileName)))) {
315
        if (!@dbase_create(str_replace('.*', '.dbf', $this->FileName), $this->DBFHeader)) {
316
          return $this->setError(sprintf("It wasn't possible to create the DBase file '%s'", str_replace('.*', '.dbf', $this->FileName)));
317
        }
318
      }
319
      if ($checkFunction(str_replace('.*', '.dbf', $this->FileName))) {
320
        $this->DBFFile = dbase_open(str_replace('.*', '.dbf', $this->FileName), ($toWrite ? 2 : 0));