Test Failed
Push — master ( a7ba1f...918038 )
by Maurício
03:22
created
src/ShapeFile.php 1 patch
Spacing   +14 added lines, -14 removed lines patch added patch discarded remove patch
@@ -88,7 +88,7 @@  discard block
 block discarded – undo
88 88
      */
89 89
     public function loadFromFile($FileName)
90 90
     {
91
-        if (! empty($FileName)) {
91
+        if (!empty($FileName)) {
92 92
             $this->FileName = $FileName;
93 93
             $result = $this->_openSHPFile();
94 94
         } else {
@@ -97,13 +97,13 @@  discard block
 block discarded – undo
97 97
         }
98 98
 
99 99
         if ($result && ($this->_openDBFFile())) {
100
-            if (! $this->_loadHeaders()) {
100
+            if (!$this->_loadHeaders()) {
101 101
                 $this->_closeSHPFile();
102 102
                 $this->_closeDBFFile();
103 103
 
104 104
                 return false;
105 105
             }
106
-            if (! $this->_loadRecords()) {
106
+            if (!$this->_loadRecords()) {
107 107
                 $this->_closeSHPFile();
108 108
                 $this->_closeDBFFile();
109 109
 
@@ -125,7 +125,7 @@  discard block
 block discarded – undo
125 125
      */
126 126
     public function saveToFile($FileName = null)
127 127
     {
128
-        if (! is_null($FileName)) {
128
+        if (!is_null($FileName)) {
129 129
             $this->FileName = $FileName;
130 130
         }
131 131
 
@@ -163,10 +163,10 @@  discard block
 block discarded – undo
163 163
         $min = $type . 'min';
164 164
         $max = $type . 'max';
165 165
 
166
-        if (! isset($this->boundingBox[$min]) || $this->boundingBox[$min] == 0.0 || ($this->boundingBox[$min] > $data[$min])) {
166
+        if (!isset($this->boundingBox[$min]) || $this->boundingBox[$min] == 0.0 || ($this->boundingBox[$min] > $data[$min])) {
167 167
             $this->boundingBox[$min] = $data[$min];
168 168
         }
169
-        if (! isset($this->boundingBox[$max]) || $this->boundingBox[$max] == 0.0 || ($this->boundingBox[$max] < $data[$max])) {
169
+        if (!isset($this->boundingBox[$max]) || $this->boundingBox[$max] == 0.0 || ($this->boundingBox[$max] < $data[$max])) {
170 170
             $this->boundingBox[$max] = $data[$max];
171 171
         }
172 172
     }
@@ -282,7 +282,7 @@  discard block
 block discarded – undo
282 282
         $inHeader = true;
283 283
 
284 284
         while ($inHeader) {
285
-            if (! feof($DBFFile)) {
285
+            if (!feof($DBFFile)) {
286 286
                 $buff32 = fread($DBFFile, 32);
287 287
                 if ($i > 1) {
288 288
                     if (substr($buff32, 0, 1) == chr(13)) {
@@ -418,7 +418,7 @@  discard block
 block discarded – undo
418 418
     private function _loadRecords()
419 419
     {
420 420
         /* Need to start at offset 100 */
421
-        while (! $this->eofSHP()) {
421
+        while (!$this->eofSHP()) {
422 422
             $record = new ShapeRecord(-1);
423 423
             $record->loadFromFile($this, $this->SHPFile, $this->DBFFile);
424 424
             if ($record->lastError != '') {
@@ -468,7 +468,7 @@  discard block
 block discarded – undo
468 468
     {
469 469
         $shp_name = $this->_getFilename($extension);
470 470
         $result = @fopen($shp_name, ($toWrite ? 'wb+' : 'rb'));
471
-        if (! $result) {
471
+        if (!$result) {
472 472
             $this->setError(sprintf('It wasn\'t possible to open the %s file "%s"', $name, $shp_name));
473 473
 
474 474
             return false;
@@ -487,7 +487,7 @@  discard block
 block discarded – undo
487 487
     private function _openSHPFile($toWrite = false)
488 488
     {
489 489
         $this->SHPFile = $this->_openFile($toWrite, '.shp', 'Shape');
490
-        if (! $this->SHPFile) {
490
+        if (!$this->SHPFile) {
491 491
             return false;
492 492
         }
493 493
 
@@ -515,7 +515,7 @@  discard block
 block discarded – undo
515 515
     private function _openSHXFile($toWrite = false)
516 516
     {
517 517
         $this->SHXFile = $this->_openFile($toWrite, '.shx', 'Index');
518
-        if (! $this->SHXFile) {
518
+        if (!$this->SHXFile) {
519 519
             return false;
520 520
         }
521 521
 
@@ -540,7 +540,7 @@  discard block
 block discarded – undo
540 540
      */
541 541
     private function _createDBFFile()
542 542
     {
543
-        if (! self::supportsDbase() || ! is_array($this->DBFHeader) || count($this->DBFHeader) == 0) {
543
+        if (!self::supportsDbase() || !is_array($this->DBFHeader) || count($this->DBFHeader) == 0) {
544 544
             $this->DBFFile = null;
545 545
 
546 546
             return true;
@@ -570,7 +570,7 @@  discard block
 block discarded – undo
570 570
      */
571 571
     private function _openDBFFile()
572 572
     {
573
-        if (! self::supportsDbase()) {
573
+        if (!self::supportsDbase()) {
574 574
             $this->DBFFile = null;
575 575
 
576 576
             return true;
@@ -578,7 +578,7 @@  discard block
 block discarded – undo
578 578
         $dbf_name = $this->_getFilename('.dbf');
579 579
         if (is_readable($dbf_name)) {
580 580
             $this->DBFFile = @dbase_open($dbf_name, 0);
581
-            if (! $this->DBFFile) {
581
+            if (!$this->DBFFile) {
582 582
                 $this->setError(sprintf('It wasn\'t possible to open the DBase file "%s"', $dbf_name));
583 583
 
584 584
                 return false;
Please login to merge, or discard this patch.
src/ShapeRecord.php 1 patch
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -187,7 +187,7 @@  discard block
 block discarded – undo
187 187
                 $this->setError(sprintf('The Shape Type "%s" is not supported.', $this->shapeType));
188 188
                 break;
189 189
         }
190
-        if (ShapeFile::supportsDbase() && ! is_null($this->DBFFile)) {
190
+        if (ShapeFile::supportsDbase() && !is_null($this->DBFFile)) {
191 191
             $this->_saveDBFData();
192 192
         }
193 193
     }
@@ -366,7 +366,7 @@  discard block
 block discarded – undo
366 366
     private function _loadMultiPointMZRecord($type)
367 367
     {
368 368
         /* The m dimension is optional, depends on bounding box data */
369
-        if ($type == 'm' && ! $this->ShapeFile->hasMeasure()) {
369
+        if ($type == 'm' && !$this->ShapeFile->hasMeasure()) {
370 370
             return;
371 371
         }
372 372
 
@@ -451,7 +451,7 @@  discard block
 block discarded – undo
451 451
             if ($part + 1 < $numparts && $i == $this->SHPData['parts'][$part + 1]) {
452 452
                 ++$part;
453 453
             }
454
-            if (! isset($this->SHPData['parts'][$part]['points']) || ! is_array($this->SHPData['parts'][$part]['points'])) {
454
+            if (!isset($this->SHPData['parts'][$part]['points']) || !is_array($this->SHPData['parts'][$part]['points'])) {
455 455
                 $this->SHPData['parts'][$part] = ['points' => []];
456 456
             }
457 457
             $this->SHPData['parts'][$part]['points'][] = $this->_loadPoint();
@@ -464,7 +464,7 @@  discard block
 block discarded – undo
464 464
     private function _loadPolyLineMZRecord($type)
465 465
     {
466 466
         /* The m dimension is optional, depends on bounding box data */
467
-        if ($type == 'm' && ! $this->ShapeFile->hasMeasure()) {
467
+        if ($type == 'm' && !$this->ShapeFile->hasMeasure()) {
468 468
             return;
469 469
         }
470 470
 
@@ -586,15 +586,15 @@  discard block
 block discarded – undo
586 586
             'm',
587 587
         ];
588 588
         foreach ($directions as $direction) {
589
-            if (! isset($point[$direction])) {
589
+            if (!isset($point[$direction])) {
590 590
                 continue;
591 591
             }
592 592
             $min = $direction . 'min';
593 593
             $max = $direction . 'max';
594
-            if (! isset($this->SHPData[$min]) || ($this->SHPData[$min] > $point[$direction])) {
594
+            if (!isset($this->SHPData[$min]) || ($this->SHPData[$min] > $point[$direction])) {
595 595
                 $this->SHPData[$min] = $point[$direction];
596 596
             }
597
-            if (! isset($this->SHPData[$max]) || ($this->SHPData[$max] < $point[$direction])) {
597
+            if (!isset($this->SHPData[$max]) || ($this->SHPData[$max] < $point[$direction])) {
598 598
                 $this->SHPData[$max] = $point[$direction];
599 599
             }
600 600
         }
@@ -610,7 +610,7 @@  discard block
 block discarded – undo
610 610
      */
611 611
     private function _fixPoint($point, $dimension)
612 612
     {
613
-        if (! isset($point[$dimension])) {
613
+        if (!isset($point[$dimension])) {
614 614
             $point[$dimension] = 0.0; // no_value
615 615
         }
616 616
 
@@ -822,11 +822,11 @@  discard block
 block discarded – undo
822 822
         }
823 823
         unset($this->DBFData['deleted']);
824 824
         if ($this->recordNumber <= dbase_numrecords($this->DBFFile)) {
825
-            if (! dbase_replace_record($this->DBFFile, array_values($this->DBFData), $this->recordNumber)) {
825
+            if (!dbase_replace_record($this->DBFFile, array_values($this->DBFData), $this->recordNumber)) {
826 826
                 $this->setError('I wasn\'t possible to update the information in the DBF file.');
827 827
             }
828 828
         } else {
829
-            if (! dbase_add_record($this->DBFFile, array_values($this->DBFData))) {
829
+            if (!dbase_add_record($this->DBFFile, array_values($this->DBFData))) {
830 830
                 $this->setError('I wasn\'t possible to add the information to the DBF file.');
831 831
             }
832 832
         }
Please login to merge, or discard this patch.