@@ -188,7 +188,7 @@ discard block |
||
| 188 | 188 | $this->setError(sprintf('The Shape Type "%s" is not supported.', $this->shapeType)); |
| 189 | 189 | break; |
| 190 | 190 | } |
| 191 | - if (ShapeFile::supportsDbase() && ! is_null($this->DBFFile)) { |
|
| 191 | + if (ShapeFile::supportsDbase() && !is_null($this->DBFFile)) { |
|
| 192 | 192 | $this->saveDBFData(); |
| 193 | 193 | } |
| 194 | 194 | } |
@@ -367,7 +367,7 @@ discard block |
||
| 367 | 367 | private function loadMultiPointMZRecord($type) |
| 368 | 368 | { |
| 369 | 369 | /* The m dimension is optional, depends on bounding box data */ |
| 370 | - if ($type == 'm' && ! $this->ShapeFile->hasMeasure()) { |
|
| 370 | + if ($type == 'm' && !$this->ShapeFile->hasMeasure()) { |
|
| 371 | 371 | return; |
| 372 | 372 | } |
| 373 | 373 | |
@@ -452,7 +452,7 @@ discard block |
||
| 452 | 452 | if ($part + 1 < $numparts && $i == $this->SHPData['parts'][$part + 1]) { |
| 453 | 453 | ++$part; |
| 454 | 454 | } |
| 455 | - if (! isset($this->SHPData['parts'][$part]['points']) || ! is_array($this->SHPData['parts'][$part]['points'])) { |
|
| 455 | + if (!isset($this->SHPData['parts'][$part]['points']) || !is_array($this->SHPData['parts'][$part]['points'])) { |
|
| 456 | 456 | $this->SHPData['parts'][$part] = ['points' => []]; |
| 457 | 457 | } |
| 458 | 458 | $this->SHPData['parts'][$part]['points'][] = $this->loadPoint(); |
@@ -465,7 +465,7 @@ discard block |
||
| 465 | 465 | private function loadPolyLineMZRecord($type) |
| 466 | 466 | { |
| 467 | 467 | /* The m dimension is optional, depends on bounding box data */ |
| 468 | - if ($type == 'm' && ! $this->ShapeFile->hasMeasure()) { |
|
| 468 | + if ($type == 'm' && !$this->ShapeFile->hasMeasure()) { |
|
| 469 | 469 | return; |
| 470 | 470 | } |
| 471 | 471 | |
@@ -587,15 +587,15 @@ discard block |
||
| 587 | 587 | 'm', |
| 588 | 588 | ]; |
| 589 | 589 | foreach ($directions as $direction) { |
| 590 | - if (! isset($point[$direction])) { |
|
| 590 | + if (!isset($point[$direction])) { |
|
| 591 | 591 | continue; |
| 592 | 592 | } |
| 593 | 593 | $min = $direction . 'min'; |
| 594 | 594 | $max = $direction . 'max'; |
| 595 | - if (! isset($this->SHPData[$min]) || ($this->SHPData[$min] > $point[$direction])) { |
|
| 595 | + if (!isset($this->SHPData[$min]) || ($this->SHPData[$min] > $point[$direction])) { |
|
| 596 | 596 | $this->SHPData[$min] = $point[$direction]; |
| 597 | 597 | } |
| 598 | - if (! isset($this->SHPData[$max]) || ($this->SHPData[$max] < $point[$direction])) { |
|
| 598 | + if (!isset($this->SHPData[$max]) || ($this->SHPData[$max] < $point[$direction])) { |
|
| 599 | 599 | $this->SHPData[$max] = $point[$direction]; |
| 600 | 600 | } |
| 601 | 601 | } |
@@ -611,7 +611,7 @@ discard block |
||
| 611 | 611 | */ |
| 612 | 612 | private function fixPoint($point, $dimension) |
| 613 | 613 | { |
| 614 | - if (! isset($point[$dimension])) { |
|
| 614 | + if (!isset($point[$dimension])) { |
|
| 615 | 615 | $point[$dimension] = 0.0; // no_value |
| 616 | 616 | } |
| 617 | 617 | |
@@ -823,11 +823,11 @@ discard block |
||
| 823 | 823 | } |
| 824 | 824 | unset($this->DBFData['deleted']); |
| 825 | 825 | if ($this->recordNumber <= dbase_numrecords($this->DBFFile)) { |
| 826 | - if (! dbase_replace_record($this->DBFFile, array_values($this->DBFData), $this->recordNumber)) { |
|
| 826 | + if (!dbase_replace_record($this->DBFFile, array_values($this->DBFData), $this->recordNumber)) { |
|
| 827 | 827 | $this->setError('I wasn\'t possible to update the information in the DBF file.'); |
| 828 | 828 | } |
| 829 | 829 | } else { |
| 830 | - if (! dbase_add_record($this->DBFFile, array_values($this->DBFData))) { |
|
| 830 | + if (!dbase_add_record($this->DBFFile, array_values($this->DBFData))) { |
|
| 831 | 831 | $this->setError('I wasn\'t possible to add the information to the DBF file.'); |
| 832 | 832 | } |
| 833 | 833 | } |
@@ -89,7 +89,7 @@ discard block |
||
| 89 | 89 | */ |
| 90 | 90 | public function loadFromFile($FileName) |
| 91 | 91 | { |
| 92 | - if (! empty($FileName)) { |
|
| 92 | + if (!empty($FileName)) { |
|
| 93 | 93 | $this->FileName = $FileName; |
| 94 | 94 | $result = $this->openSHPFile(); |
| 95 | 95 | } else { |
@@ -98,13 +98,13 @@ discard block |
||
| 98 | 98 | } |
| 99 | 99 | |
| 100 | 100 | if ($result && ($this->openDBFFile())) { |
| 101 | - if (! $this->loadHeaders()) { |
|
| 101 | + if (!$this->loadHeaders()) { |
|
| 102 | 102 | $this->closeSHPFile(); |
| 103 | 103 | $this->closeDBFFile(); |
| 104 | 104 | |
| 105 | 105 | return false; |
| 106 | 106 | } |
| 107 | - if (! $this->loadRecords()) { |
|
| 107 | + if (!$this->loadRecords()) { |
|
| 108 | 108 | $this->closeSHPFile(); |
| 109 | 109 | $this->closeDBFFile(); |
| 110 | 110 | |
@@ -126,7 +126,7 @@ discard block |
||
| 126 | 126 | */ |
| 127 | 127 | public function saveToFile($FileName = null) |
| 128 | 128 | { |
| 129 | - if (! is_null($FileName)) { |
|
| 129 | + if (!is_null($FileName)) { |
|
| 130 | 130 | $this->FileName = $FileName; |
| 131 | 131 | } |
| 132 | 132 | |
@@ -164,10 +164,10 @@ discard block |
||
| 164 | 164 | $min = $type . 'min'; |
| 165 | 165 | $max = $type . 'max'; |
| 166 | 166 | |
| 167 | - if (! isset($this->boundingBox[$min]) || $this->boundingBox[$min] == 0.0 || ($this->boundingBox[$min] > $data[$min])) { |
|
| 167 | + if (!isset($this->boundingBox[$min]) || $this->boundingBox[$min] == 0.0 || ($this->boundingBox[$min] > $data[$min])) { |
|
| 168 | 168 | $this->boundingBox[$min] = $data[$min]; |
| 169 | 169 | } |
| 170 | - if (! isset($this->boundingBox[$max]) || $this->boundingBox[$max] == 0.0 || ($this->boundingBox[$max] < $data[$max])) { |
|
| 170 | + if (!isset($this->boundingBox[$max]) || $this->boundingBox[$max] == 0.0 || ($this->boundingBox[$max] < $data[$max])) { |
|
| 171 | 171 | $this->boundingBox[$max] = $data[$max]; |
| 172 | 172 | } |
| 173 | 173 | } |
@@ -283,7 +283,7 @@ discard block |
||
| 283 | 283 | $inHeader = true; |
| 284 | 284 | |
| 285 | 285 | while ($inHeader) { |
| 286 | - if (! feof($DBFFile)) { |
|
| 286 | + if (!feof($DBFFile)) { |
|
| 287 | 287 | $buff32 = fread($DBFFile, 32); |
| 288 | 288 | if ($i > 1) { |
| 289 | 289 | if (substr($buff32, 0, 1) == chr(13)) { |
@@ -419,7 +419,7 @@ discard block |
||
| 419 | 419 | private function loadRecords() |
| 420 | 420 | { |
| 421 | 421 | /* Need to start at offset 100 */ |
| 422 | - while (! $this->eofSHP()) { |
|
| 422 | + while (!$this->eofSHP()) { |
|
| 423 | 423 | $record = new ShapeRecord(-1); |
| 424 | 424 | $record->loadFromFile($this, $this->SHPFile, $this->DBFFile); |
| 425 | 425 | if ($record->lastError != '') { |
@@ -469,7 +469,7 @@ discard block |
||
| 469 | 469 | { |
| 470 | 470 | $shp_name = $this->getFilename($extension); |
| 471 | 471 | $result = @fopen($shp_name, ($toWrite ? 'wb+' : 'rb')); |
| 472 | - if (! $result) { |
|
| 472 | + if (!$result) { |
|
| 473 | 473 | $this->setError(sprintf('It wasn\'t possible to open the %s file "%s"', $name, $shp_name)); |
| 474 | 474 | |
| 475 | 475 | return false; |
@@ -488,7 +488,7 @@ discard block |
||
| 488 | 488 | private function openSHPFile($toWrite = false) |
| 489 | 489 | { |
| 490 | 490 | $this->SHPFile = $this->openFile($toWrite, '.shp', 'Shape'); |
| 491 | - if (! $this->SHPFile) { |
|
| 491 | + if (!$this->SHPFile) { |
|
| 492 | 492 | return false; |
| 493 | 493 | } |
| 494 | 494 | |
@@ -516,7 +516,7 @@ discard block |
||
| 516 | 516 | private function openSHXFile($toWrite = false) |
| 517 | 517 | { |
| 518 | 518 | $this->SHXFile = $this->openFile($toWrite, '.shx', 'Index'); |
| 519 | - if (! $this->SHXFile) { |
|
| 519 | + if (!$this->SHXFile) { |
|
| 520 | 520 | return false; |
| 521 | 521 | } |
| 522 | 522 | |
@@ -541,7 +541,7 @@ discard block |
||
| 541 | 541 | */ |
| 542 | 542 | private function createDBFFile() |
| 543 | 543 | { |
| 544 | - if (! self::supportsDbase() || ! is_array($this->DBFHeader) || count($this->DBFHeader) == 0) { |
|
| 544 | + if (!self::supportsDbase() || !is_array($this->DBFHeader) || count($this->DBFHeader) == 0) { |
|
| 545 | 545 | $this->DBFFile = null; |
| 546 | 546 | |
| 547 | 547 | return true; |
@@ -571,7 +571,7 @@ discard block |
||
| 571 | 571 | */ |
| 572 | 572 | private function openDBFFile() |
| 573 | 573 | { |
| 574 | - if (! self::supportsDbase()) { |
|
| 574 | + if (!self::supportsDbase()) { |
|
| 575 | 575 | $this->DBFFile = null; |
| 576 | 576 | |
| 577 | 577 | return true; |
@@ -579,7 +579,7 @@ discard block |
||
| 579 | 579 | $dbf_name = $this->getFilename('.dbf'); |
| 580 | 580 | if (is_readable($dbf_name)) { |
| 581 | 581 | $this->DBFFile = @dbase_open($dbf_name, 0); |
| 582 | - if (! $this->DBFFile) { |
|
| 582 | + if (!$this->DBFFile) { |
|
| 583 | 583 | $this->setError(sprintf('It wasn\'t possible to open the DBase file "%s"', $dbf_name)); |
| 584 | 584 | |
| 585 | 585 | return false; |