Code Duplication    Length = 3-3 lines in 2 locations

src/ShapeFile.lib.php 2 locations

@@ 292-294 (lines=3) @@
289
      if (file_exists(str_replace('.*', '.dbf', $this->FileName))) {
290
        @unlink(str_replace('.*', '.dbf', $this->FileName));
291
      }
292
      if (!($this->DBFFile = @dbase_create(str_replace('.*', '.dbf', $this->FileName), $this->DBFHeader))) {
293
        return $this->setError(sprintf("It wasn't possible to create the DBase file '%s'", str_replace('.*', '.dbf', $this->FileName)));
294
      }
295
296
      $offset = 50;
297
      if (is_array($this->records) && (count($this->records) > 0)) {
@@ 347-349 (lines=3) @@
344
    function _openDBFFile($toWrite = false) {
345
      $checkFunction = $toWrite ? "is_writable" : "is_readable";
346
      if (($toWrite) && (!file_exists(str_replace('.*', '.dbf', $this->FileName)))) {
347
        if (!@dbase_create(str_replace('.*', '.dbf', $this->FileName), $this->DBFHeader)) {
348
          return $this->setError(sprintf("It wasn't possible to create the DBase file '%s'", str_replace('.*', '.dbf', $this->FileName)));
349
        }
350
      }
351
      if ($checkFunction(str_replace('.*', '.dbf', $this->FileName))) {
352
        $this->DBFFile = dbase_open(str_replace('.*', '.dbf', $this->FileName), ($toWrite ? 2 : 0));