Completed
Push — master ( e53124...f4ebe5 )
by Michal
03:46
created
src/ShapeRecord.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -298,7 +298,7 @@  discard block
 block discarded – undo
298 298
      */
299 299
     private function _saveMultiPointMZRecord($type) {
300 300
 
301
-        fwrite($this->SHPFile, pack('dd', $this->SHPData[$type . 'min'], $this->SHPData[$type . 'max']));
301
+        fwrite($this->SHPFile, pack('dd', $this->SHPData[$type.'min'], $this->SHPData[$type.'max']));
302 302
 
303 303
         for ($i = 0; $i <= $this->SHPData['numpoints']; $i++) {
304 304
             fwrite($this->SHPFile, Util::packDouble($this->SHPData['points'][$type]));
@@ -454,8 +454,8 @@  discard block
 block discarded – undo
454 454
             if (!isset($point[$direction])) {
455 455
                 continue;
456 456
             }
457
-            $min = $direction . 'min';
458
-            $max = $direction . 'max';
457
+            $min = $direction.'min';
458
+            $max = $direction.'max';
459 459
             if (!isset($this->SHPData[$min]) || ($this->SHPData[$min] > $point[$direction])) {
460 460
                 $this->SHPData[$min] = $point[$direction];
461 461
             }
Please login to merge, or discard this patch.
tests/ShapeFileTest.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -145,7 +145,7 @@  discard block
 block discarded – undo
145 145
      */
146 146
     public function testCreate()
147 147
     {
148
-        if (! ShapeFile::supports_dbase()) {
148
+        if (!ShapeFile::supports_dbase()) {
149 149
             $this->markTestSkipped('dbase extension missing');
150 150
         }
151 151
         $this->createTestData();
@@ -162,7 +162,7 @@  discard block
 block discarded – undo
162 162
      */
163 163
     public function testDelete()
164 164
     {
165
-        if (! ShapeFile::supports_dbase()) {
165
+        if (!ShapeFile::supports_dbase()) {
166 166
             $this->markTestSkipped('dbase extension missing');
167 167
         }
168 168
         $this->createTestData();
@@ -185,7 +185,7 @@  discard block
 block discarded – undo
185 185
      */
186 186
     public function testAdd()
187 187
     {
188
-        if (! ShapeFile::supports_dbase()) {
188
+        if (!ShapeFile::supports_dbase()) {
189 189
             $this->markTestSkipped('dbase extension missing');
190 190
         }
191 191
         $this->createTestData();
Please login to merge, or discard this patch.
src/ShapeFile.php 2 patches
Doc Comments   +5 added lines, -1 removed lines patch added patch discarded remove patch
@@ -157,6 +157,9 @@  discard block
 block discarded – undo
157 157
         return (count($this->records) - 1);
158 158
     }
159 159
 
160
+    /**
161
+     * @param integer $index
162
+     */
160 163
     public function deleteRecord($index) {
161 164
         if (isset($this->records[$index])) {
162 165
             $this->fileLength -= ($this->records[$index]->getContentLength() + 4);
@@ -410,7 +413,8 @@  discard block
 block discarded – undo
410 413
     /**
411 414
      * Reads given number of bytes from SHP file
412 415
      *
413
-     * @return string|false
416
+     * @param integer $bytes
417
+     * @return string
414 418
      */
415 419
     public function readSHP($bytes)
416 420
     {
Please login to merge, or discard this patch.
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -70,7 +70,7 @@  discard block
 block discarded – undo
70 70
         $this->FileName = $FileName;
71 71
 
72 72
         if (($this->_openSHPFile()) && ($this->_openDBFFile())) {
73
-            if (! $this->_loadHeaders()) {
73
+            if (!$this->_loadHeaders()) {
74 74
                 $this->_closeSHPFile();
75 75
                 $this->_closeDBFFile();
76 76
                 return false;
@@ -88,7 +88,7 @@  discard block
 block discarded – undo
88 88
      * @param string|null $FileName Name of file to open
89 89
      */
90 90
     public function saveToFile($FileName = null) {
91
-        if (! is_null($FileName)) {
91
+        if (!is_null($FileName)) {
92 92
             $this->FileName = $FileName;
93 93
         }
94 94
 
@@ -316,7 +316,7 @@  discard block
 block discarded – undo
316 316
     }
317 317
 
318 318
     private function _saveRecords() {
319
-        if (! ShapeFile::supports_dbase()) {
319
+        if (!ShapeFile::supports_dbase()) {
320 320
             return;
321 321
         }
322 322
         $dbf_name = $this->_getFilename('.dbf');
@@ -382,7 +382,7 @@  discard block
 block discarded – undo
382 382
      * @return bool
383 383
      */
384 384
     private function _openDBFFile($toWrite = false) {
385
-        if (! ShapeFile::supports_dbase()) {
385
+        if (!ShapeFile::supports_dbase()) {
386 386
             return true;
387 387
         }
388 388
         $dbf_name = $this->_getFilename('.dbf');
Please login to merge, or discard this patch.