Completed
Pull Request — develop (#47)
by
unknown
10:56
created
src/PhpSpreadsheet/Reader/Excel2003XML.php 1 patch
Spacing   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -115,10 +115,10 @@  discard block
 block discarded – undo
115 115
     {
116 116
         // Check if file exists
117 117
         if (!file_exists($pFilename)) {
118
-            throw new Exception('Could not open '.$pFilename.' for reading! File does not exist.');
118
+            throw new Exception('Could not open ' . $pFilename . ' for reading! File does not exist.');
119 119
         }
120 120
         if (!$this->canRead($pFilename)) {
121
-            throw new Exception($pFilename.' is an Invalid Spreadsheet file.');
121
+            throw new Exception($pFilename . ' is an Invalid Spreadsheet file.');
122 122
         }
123 123
 
124 124
         $worksheetNames = [];
@@ -150,7 +150,7 @@  discard block
 block discarded – undo
150 150
     {
151 151
         // Check if file exists
152 152
         if (!file_exists($pFilename)) {
153
-            throw new Exception('Could not open '.$pFilename.' for reading! File does not exist.');
153
+            throw new Exception('Could not open ' . $pFilename . ' for reading! File does not exist.');
154 154
         }
155 155
 
156 156
         $worksheetInfo = [];
@@ -327,11 +327,11 @@  discard block
 block discarded – undo
327 327
 
328 328
         // Check if file exists
329 329
         if (!file_exists($pFilename)) {
330
-            throw new Exception('Could not open '.$pFilename.' for reading! File does not exist.');
330
+            throw new Exception('Could not open ' . $pFilename . ' for reading! File does not exist.');
331 331
         }
332 332
 
333 333
         if (!$this->canRead($pFilename)) {
334
-            throw new Exception($pFilename.' is an Invalid Spreadsheet file.');
334
+            throw new Exception($pFilename . ' is an Invalid Spreadsheet file.');
335 335
         }
336 336
 
337 337
         $xml = simplexml_load_string(
@@ -578,7 +578,7 @@  discard block
 block discarded – undo
578 578
                         if (isset($cell_ss['Index'])) {
579 579
                             $columnID = \PhpOffice\PhpSpreadsheet\Cell::stringFromColumnIndex($cell_ss['Index'] - 1);
580 580
                         }
581
-                        $cellRange = $columnID.$rowID;
581
+                        $cellRange = $columnID . $rowID;
582 582
 
583 583
                         if ($this->getReadFilter() !== null) {
584 584
                             if (!$this->getReadFilter()->readCell($columnID, $rowID, $worksheetName)) {
@@ -596,7 +596,7 @@  discard block
 block discarded – undo
596 596
                             if (isset($cell_ss['MergeDown'])) {
597 597
                                 $rowTo = $rowTo + $cell_ss['MergeDown'];
598 598
                             }
599
-                            $cellRange .= ':'.$columnTo.$rowTo;
599
+                            $cellRange .= ':' . $columnTo . $rowTo;
600 600
                             $spreadsheet->getActiveSheet()->mergeCells($cellRange);
601 601
                         }
602 602
 
@@ -697,7 +697,7 @@  discard block
 block discarded – undo
697 697
                                                 if ($columnReference{0} == '[') {
698 698
                                                     $columnReference = $columnNumber + trim($columnReference, '[]');
699 699
                                                 }
700
-                                                $A1CellReference = \PhpOffice\PhpSpreadsheet\Cell::stringFromColumnIndex($columnReference - 1).$rowReference;
700
+                                                $A1CellReference = \PhpOffice\PhpSpreadsheet\Cell::stringFromColumnIndex($columnReference - 1) . $rowReference;
701 701
                                                 $value = substr_replace($value, $A1CellReference, $cellReference[0][1], strlen($cellReference[0][0]));
702 702
                                             }
703 703
                                         }
@@ -708,9 +708,9 @@  discard block
 block discarded – undo
708 708
                                 $cellDataFormula = implode('"', $temp);
709 709
                             }
710 710
 
711
-                            $spreadsheet->getActiveSheet()->getCell($columnID.$rowID)->setValueExplicit((($hasCalculatedValue) ? $cellDataFormula : $cellValue), $type);
711
+                            $spreadsheet->getActiveSheet()->getCell($columnID . $rowID)->setValueExplicit((($hasCalculatedValue) ? $cellDataFormula : $cellValue), $type);
712 712
                             if ($hasCalculatedValue) {
713
-                                $spreadsheet->getActiveSheet()->getCell($columnID.$rowID)->setCalculatedValue($cellValue);
713
+                                $spreadsheet->getActiveSheet()->getCell($columnID . $rowID)->setCalculatedValue($cellValue);
714 714
                             }
715 715
                             $cellIsSet = $rowHasData = true;
716 716
                         }
@@ -723,14 +723,14 @@  discard block
 block discarded – undo
723 723
                             }
724 724
                             $node = $cell->Comment->Data->asXML();
725 725
                             $annotation = strip_tags($node);
726
-                            $spreadsheet->getActiveSheet()->getComment($columnID.$rowID)->setAuthor(self::convertStringEncoding($author, $this->charSet))->setText($this->parseRichText($annotation));
726
+                            $spreadsheet->getActiveSheet()->getComment($columnID . $rowID)->setAuthor(self::convertStringEncoding($author, $this->charSet))->setText($this->parseRichText($annotation));
727 727
                         }
728 728
 
729 729
                         if (($cellIsSet) && (isset($cell_ss['StyleID']))) {
730 730
                             $style = (string) $cell_ss['StyleID'];
731 731
                             if ((isset($this->styles[$style])) && (!empty($this->styles[$style]))) {
732
-                                if (!$spreadsheet->getActiveSheet()->cellExists($columnID.$rowID)) {
733
-                                    $spreadsheet->getActiveSheet()->getCell($columnID.$rowID)->setValue(null);
732
+                                if (!$spreadsheet->getActiveSheet()->cellExists($columnID . $rowID)) {
733
+                                    $spreadsheet->getActiveSheet()->getCell($columnID . $rowID)->setValue(null);
734 734
                                 }
735 735
                                 $spreadsheet->getActiveSheet()->getStyle($cellRange)->applyFromArray($this->styles[$style]);
736 736
                             }
Please login to merge, or discard this patch.
src/PhpSpreadsheet/Reader/BaseReader.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -239,13 +239,13 @@  discard block
 block discarded – undo
239 239
     {
240 240
         // Check if file exists
241 241
         if (!file_exists($pFilename) || !is_readable($pFilename)) {
242
-            throw new Exception('Could not open '.$pFilename.' for reading! File does not exist.');
242
+            throw new Exception('Could not open ' . $pFilename . ' for reading! File does not exist.');
243 243
         }
244 244
 
245 245
         // Open file
246 246
         $this->fileHandle = fopen($pFilename, 'r');
247 247
         if ($this->fileHandle === false) {
248
-            throw new Exception('Could not open file '.$pFilename.' for reading.');
248
+            throw new Exception('Could not open file ' . $pFilename . ' for reading.');
249 249
         }
250 250
     }
251 251
 
@@ -258,7 +258,7 @@  discard block
 block discarded – undo
258 258
      */
259 259
     public function securityScan($xml)
260 260
     {
261
-        $pattern = '/\\0?'.implode('\\0?', str_split('<!DOCTYPE')).'\\0?/';
261
+        $pattern = '/\\0?' . implode('\\0?', str_split('<!DOCTYPE')) . '\\0?/';
262 262
         if (preg_match($pattern, $xml)) {
263 263
             throw new Exception('Detected use of ENTITY in XML, spreadsheet file load() aborted to prevent XXE/XEE attacks');
264 264
         }
Please login to merge, or discard this patch.
src/PhpSpreadsheet/Reader/SYLK.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -131,7 +131,7 @@  discard block
 block discarded – undo
131 131
     {
132 132
         // Open file
133 133
         if (!$this->canRead($pFilename)) {
134
-            throw new Exception($pFilename.' is an Invalid Spreadsheet file.');
134
+            throw new Exception($pFilename . ' is an Invalid Spreadsheet file.');
135 135
         }
136 136
         $this->openFile($pFilename);
137 137
         $fileHandle = $this->fileHandle;
@@ -221,7 +221,7 @@  discard block
 block discarded – undo
221 221
     {
222 222
         // Open file
223 223
         if (!$this->canRead($pFilename)) {
224
-            throw new Exception($pFilename.' is an Invalid Spreadsheet file.');
224
+            throw new Exception($pFilename . ' is an Invalid Spreadsheet file.');
225 225
         }
226 226
         $this->openFile($pFilename);
227 227
         $fileHandle = $this->fileHandle;
@@ -292,7 +292,7 @@  discard block
 block discarded – undo
292 292
                             break;
293 293
                     }
294 294
                 }
295
-                $this->formats['P'.$this->format++] = $formatArray;
295
+                $this->formats['P' . $this->format++] = $formatArray;
296 296
             //    Read cell value data
297 297
             } elseif ($dataType == 'C') {
298 298
                 $hasCalculatedValue = false;
@@ -311,7 +311,7 @@  discard block
 block discarded – undo
311 311
                             $cellData = substr($rowDatum, 1);
312 312
                             break;
313 313
                         case 'E':
314
-                            $cellDataFormula = '='.substr($rowDatum, 1);
314
+                            $cellDataFormula = '=' . substr($rowDatum, 1);
315 315
                             //    Convert R1C1 style references to A1 style references (but only when not quoted)
316 316
                             $temp = explode('"', $cellDataFormula);
317 317
                             $key = false;
@@ -344,7 +344,7 @@  discard block
 block discarded – undo
344 344
                                         if ($columnReference{0} == '[') {
345 345
                                             $columnReference = $column + trim($columnReference, '[]');
346 346
                                         }
347
-                                        $A1CellReference = \PhpOffice\PhpSpreadsheet\Cell::stringFromColumnIndex($columnReference - 1).$rowReference;
347
+                                        $A1CellReference = \PhpOffice\PhpSpreadsheet\Cell::stringFromColumnIndex($columnReference - 1) . $rowReference;
348 348
 
349 349
                                         $value = substr_replace($value, $A1CellReference, $cellReference[0][1], strlen($cellReference[0][0]));
350 350
                                     }
@@ -361,10 +361,10 @@  discard block
 block discarded – undo
361 361
                 $cellData = \PhpOffice\PhpSpreadsheet\Calculation::unwrapResult($cellData);
362 362
 
363 363
                 // Set cell value
364
-                $spreadsheet->getActiveSheet()->getCell($columnLetter.$row)->setValue(($hasCalculatedValue) ? $cellDataFormula : $cellData);
364
+                $spreadsheet->getActiveSheet()->getCell($columnLetter . $row)->setValue(($hasCalculatedValue) ? $cellDataFormula : $cellData);
365 365
                 if ($hasCalculatedValue) {
366 366
                     $cellData = \PhpOffice\PhpSpreadsheet\Calculation::unwrapResult($cellData);
367
-                    $spreadsheet->getActiveSheet()->getCell($columnLetter.$row)->setCalculatedValue($cellData);
367
+                    $spreadsheet->getActiveSheet()->getCell($columnLetter . $row)->setCalculatedValue($cellData);
368 368
                 }
369 369
             //    Read cell formatting
370 370
             } elseif ($dataType == 'F') {
@@ -416,12 +416,12 @@  discard block
 block discarded – undo
416 416
                 if (($formatStyle > '') && ($column > '') && ($row > '')) {
417 417
                     $columnLetter = \PhpOffice\PhpSpreadsheet\Cell::stringFromColumnIndex($column - 1);
418 418
                     if (isset($this->formats[$formatStyle])) {
419
-                        $spreadsheet->getActiveSheet()->getStyle($columnLetter.$row)->applyFromArray($this->formats[$formatStyle]);
419
+                        $spreadsheet->getActiveSheet()->getStyle($columnLetter . $row)->applyFromArray($this->formats[$formatStyle]);
420 420
                     }
421 421
                 }
422 422
                 if ((!empty($styleData)) && ($column > '') && ($row > '')) {
423 423
                     $columnLetter = \PhpOffice\PhpSpreadsheet\Cell::stringFromColumnIndex($column - 1);
424
-                    $spreadsheet->getActiveSheet()->getStyle($columnLetter.$row)->applyFromArray($styleData);
424
+                    $spreadsheet->getActiveSheet()->getStyle($columnLetter . $row)->applyFromArray($styleData);
425 425
                 }
426 426
                 if ($columnWidth > '') {
427 427
                     if ($startCol == $endCol) {
Please login to merge, or discard this patch.
src/PhpSpreadsheet/Reader/HTML.php 1 patch
Spacing   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -265,13 +265,13 @@  discard block
 block discarded – undo
265 265
                 //    Only actually write it if there's content in the string
266 266
                 //    Write to worksheet to be done here...
267 267
                 //    ... we return the cell so we can mess about with styles more easily
268
-                $sheet->setCellValue($column.$row, $cellContent, true);
268
+                $sheet->setCellValue($column . $row, $cellContent, true);
269 269
                 $this->dataArray[$row][$column] = $cellContent;
270 270
             }
271 271
         } else {
272 272
             //    We have a Rich Text run
273 273
             //    TODO
274
-            $this->dataArray[$row][$column] = 'RICH TEXT: '.$cellContent;
274
+            $this->dataArray[$row][$column] = 'RICH TEXT: ' . $cellContent;
275 275
         }
276 276
         $cellContent = (string) '';
277 277
     }
@@ -337,7 +337,7 @@  discard block
 block discarded – undo
337 337
                         $this->flushCell($sheet, $column, $row, $cellContent);
338 338
                         ++$row;
339 339
                         if (isset($this->formats[$child->nodeName])) {
340
-                            $sheet->getStyle($column.$row)->applyFromArray($this->formats[$child->nodeName]);
340
+                            $sheet->getStyle($column . $row)->applyFromArray($this->formats[$child->nodeName]);
341 341
                         } else {
342 342
                             $cellContent = '----------';
343 343
                             $this->flushCell($sheet, $column, $row, $cellContent);
@@ -358,9 +358,9 @@  discard block
 block discarded – undo
358 358
                         foreach ($attributeArray as $attributeName => $attributeValue) {
359 359
                             switch ($attributeName) {
360 360
                                 case 'href':
361
-                                    $sheet->getCell($column.$row)->getHyperlink()->setUrl($attributeValue);
361
+                                    $sheet->getCell($column . $row)->getHyperlink()->setUrl($attributeValue);
362 362
                                     if (isset($this->formats[$child->nodeName])) {
363
-                                        $sheet->getStyle($column.$row)->applyFromArray($this->formats[$child->nodeName]);
363
+                                        $sheet->getStyle($column . $row)->applyFromArray($this->formats[$child->nodeName]);
364 364
                                     }
365 365
                                     break;
366 366
                             }
@@ -390,7 +390,7 @@  discard block
 block discarded – undo
390 390
                             $this->flushCell($sheet, $column, $row, $cellContent);
391 391
 
392 392
                             if (isset($this->formats[$child->nodeName])) {
393
-                                $sheet->getStyle($column.$row)->applyFromArray($this->formats[$child->nodeName]);
393
+                                $sheet->getStyle($column . $row)->applyFromArray($this->formats[$child->nodeName]);
394 394
                             }
395 395
 
396 396
                             ++$row;
@@ -440,7 +440,7 @@  discard block
 block discarded – undo
440 440
                     case 'td':
441 441
                         $this->processDomElement($child, $sheet, $row, $column, $cellContent);
442 442
 
443
-                        while (isset($this->rowspan[$column.$row])) {
443
+                        while (isset($this->rowspan[$column . $row])) {
444 444
                             ++$column;
445 445
                         }
446 446
 
@@ -452,7 +452,7 @@  discard block
 block discarded – undo
452 452
                             for ($i = 0; $i < $attributeArray['colspan'] - 1; ++$i) {
453 453
                                 ++$columnTo;
454 454
                             }
455
-                            $range = $column.$row.':'.$columnTo.($row + $attributeArray['rowspan'] - 1);
455
+                            $range = $column . $row . ':' . $columnTo . ($row + $attributeArray['rowspan'] - 1);
456 456
                             foreach (\PhpOffice\PhpSpreadsheet\Cell::extractAllCellReferencesInRange($range) as $value) {
457 457
                                 $this->rowspan[$value] = true;
458 458
                             }
@@ -460,7 +460,7 @@  discard block
 block discarded – undo
460 460
                             $column = $columnTo;
461 461
                         } elseif (isset($attributeArray['rowspan'])) {
462 462
                             //create merging rowspan
463
-                            $range = $column.$row.':'.$column.($row + $attributeArray['rowspan'] - 1);
463
+                            $range = $column . $row . ':' . $column . ($row + $attributeArray['rowspan'] - 1);
464 464
                             foreach (\PhpOffice\PhpSpreadsheet\Cell::extractAllCellReferencesInRange($range) as $value) {
465 465
                                 $this->rowspan[$value] = true;
466 466
                             }
@@ -471,7 +471,7 @@  discard block
 block discarded – undo
471 471
                             for ($i = 0; $i < $attributeArray['colspan'] - 1; ++$i) {
472 472
                                 ++$columnTo;
473 473
                             }
474
-                            $sheet->mergeCells($column.$row.':'.$columnTo.$row);
474
+                            $sheet->mergeCells($column . $row . ':' . $columnTo . $row);
475 475
                             $column = $columnTo;
476 476
                         }
477 477
                         ++$column;
@@ -504,7 +504,7 @@  discard block
 block discarded – undo
504 504
     {
505 505
         // Validate
506 506
         if (!$this->canRead($pFilename)) {
507
-            throw new Exception($pFilename.' is an Invalid HTML file.');
507
+            throw new Exception($pFilename . ' is an Invalid HTML file.');
508 508
         }
509 509
 
510 510
         // Create new sheet
@@ -518,7 +518,7 @@  discard block
 block discarded – undo
518 518
         //    Reload the HTML file into the DOM object
519 519
         $loaded = $dom->loadHTML(mb_convert_encoding($this->securityScanFile($pFilename), 'HTML-ENTITIES', 'UTF-8'));
520 520
         if ($loaded === false) {
521
-            throw new Exception('Failed to load '.$pFilename.' as a DOM Document');
521
+            throw new Exception('Failed to load ' . $pFilename . ' as a DOM Document');
522 522
         }
523 523
 
524 524
         //    Discard white space
@@ -566,7 +566,7 @@  discard block
 block discarded – undo
566 566
      */
567 567
     public function securityScan($xml)
568 568
     {
569
-        $pattern = '/\\0?'.implode('\\0?', str_split('<!ENTITY')).'\\0?/';
569
+        $pattern = '/\\0?' . implode('\\0?', str_split('<!ENTITY')) . '\\0?/';
570 570
         if (preg_match($pattern, $xml)) {
571 571
             throw new Exception('Detected use of ENTITY in XML, spreadsheet file load() aborted to prevent XXE/XEE attacks');
572 572
         }
Please login to merge, or discard this patch.
src/PhpSpreadsheet/Reader/Xls/Escher.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -593,7 +593,7 @@  discard block
 block discarded – undo
593 593
         $endOffsetY = \PhpOffice\PhpSpreadsheet\Reader\Xls::getInt2d($recordData, 16);
594 594
 
595 595
         // set the start coordinates
596
-        $this->object->setStartCoordinates(\PhpOffice\PhpSpreadsheet\Cell::stringFromColumnIndex($c1).($r1 + 1));
596
+        $this->object->setStartCoordinates(\PhpOffice\PhpSpreadsheet\Cell::stringFromColumnIndex($c1) . ($r1 + 1));
597 597
 
598 598
         // set the start offsetX
599 599
         $this->object->setStartOffsetX($startOffsetX);
@@ -602,7 +602,7 @@  discard block
 block discarded – undo
602 602
         $this->object->setStartOffsetY($startOffsetY);
603 603
 
604 604
         // set the end coordinates
605
-        $this->object->setEndCoordinates(\PhpOffice\PhpSpreadsheet\Cell::stringFromColumnIndex($c2).($r2 + 1));
605
+        $this->object->setEndCoordinates(\PhpOffice\PhpSpreadsheet\Cell::stringFromColumnIndex($c2) . ($r2 + 1));
606 606
 
607 607
         // set the end offsetX
608 608
         $this->object->setEndOffsetX($endOffsetX);
Please login to merge, or discard this patch.
src/PhpSpreadsheet/Reader/Xls/MD5.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -200,6 +200,6 @@
 block discarded – undo
200 200
     {
201 201
         $binary = str_pad(decbin($decimal), 32, '0', STR_PAD_LEFT);
202 202
 
203
-        return bindec(substr($binary, $bits).substr($binary, 0, $bits));
203
+        return bindec(substr($binary, $bits) . substr($binary, 0, $bits));
204 204
     }
205 205
 }
Please login to merge, or discard this patch.
src/PhpSpreadsheet/Reader/Ods.php 1 patch
Spacing   +18 added lines, -18 removed lines patch added patch discarded remove patch
@@ -59,7 +59,7 @@  discard block
 block discarded – undo
59 59
     {
60 60
         // Check if file exists
61 61
         if (!file_exists($pFilename)) {
62
-            throw new Exception('Could not open '.$pFilename.' for reading! File does not exist.');
62
+            throw new Exception('Could not open ' . $pFilename . ' for reading! File does not exist.');
63 63
         }
64 64
 
65 65
         $zipClass = \PhpOffice\PhpSpreadsheet\Settings::getZipClass();
@@ -115,21 +115,21 @@  discard block
 block discarded – undo
115 115
     {
116 116
         // Check if file exists
117 117
         if (!file_exists($pFilename)) {
118
-            throw new Exception('Could not open '.$pFilename.' for reading! File does not exist.');
118
+            throw new Exception('Could not open ' . $pFilename . ' for reading! File does not exist.');
119 119
         }
120 120
 
121 121
         $zipClass = \PhpOffice\PhpSpreadsheet\Settings::getZipClass();
122 122
 
123 123
         $zip = new $zipClass();
124 124
         if (!$zip->open($pFilename)) {
125
-            throw new Exception('Could not open '.$pFilename.' for reading! Error opening file.');
125
+            throw new Exception('Could not open ' . $pFilename . ' for reading! Error opening file.');
126 126
         }
127 127
 
128 128
         $worksheetNames = [];
129 129
 
130 130
         $xml = new XMLReader();
131 131
         $res = $xml->xml(
132
-            $this->securityScanFile('zip://'.realpath($pFilename).'#content.xml'),
132
+            $this->securityScanFile('zip://' . realpath($pFilename) . '#content.xml'),
133 133
             null,
134 134
             \PhpOffice\PhpSpreadsheet\Settings::getLibXmlLoaderOptions()
135 135
         );
@@ -172,7 +172,7 @@  discard block
 block discarded – undo
172 172
     {
173 173
         // Check if file exists
174 174
         if (!file_exists($pFilename)) {
175
-            throw new Exception('Could not open '.$pFilename.' for reading! File does not exist.');
175
+            throw new Exception('Could not open ' . $pFilename . ' for reading! File does not exist.');
176 176
         }
177 177
 
178 178
         $worksheetInfo = [];
@@ -181,12 +181,12 @@  discard block
 block discarded – undo
181 181
 
182 182
         $zip = new $zipClass();
183 183
         if (!$zip->open($pFilename)) {
184
-            throw new Exception('Could not open '.$pFilename.' for reading! Error opening file.');
184
+            throw new Exception('Could not open ' . $pFilename . ' for reading! Error opening file.');
185 185
         }
186 186
 
187 187
         $xml = new XMLReader();
188 188
         $res = $xml->xml(
189
-            $this->securityScanFile('zip://'.realpath($pFilename).'#content.xml'),
189
+            $this->securityScanFile('zip://' . realpath($pFilename) . '#content.xml'),
190 190
             null,
191 191
             \PhpOffice\PhpSpreadsheet\Settings::getLibXmlLoaderOptions()
192 192
         );
@@ -302,7 +302,7 @@  discard block
 block discarded – undo
302 302
     {
303 303
         // Check if file exists
304 304
         if (!file_exists($pFilename)) {
305
-            throw new Exception('Could not open '.$pFilename.' for reading! File does not exist.');
305
+            throw new Exception('Could not open ' . $pFilename . ' for reading! File does not exist.');
306 306
         }
307 307
 
308 308
         $timezoneObj = new DateTimeZone('Europe/London');
@@ -312,7 +312,7 @@  discard block
 block discarded – undo
312 312
 
313 313
         $zip = new $zipClass();
314 314
         if (!$zip->open($pFilename)) {
315
-            throw new Exception('Could not open '.$pFilename.' for reading! Error opening file.');
315
+            throw new Exception('Could not open ' . $pFilename . ' for reading! Error opening file.');
316 316
         }
317 317
 
318 318
         $xml = simplexml_load_string(
@@ -476,7 +476,7 @@  discard block
 block discarded – undo
476 476
                                         }
477 477
                                     }
478 478
                                     $text = implode("\n", $textArray);
479
-                                    $spreadsheet->getActiveSheet()->getComment($columnID.$rowID)->setText($this->parseRichText($text));
479
+                                    $spreadsheet->getActiveSheet()->getComment($columnID . $rowID)->setText($this->parseRichText($text));
480 480
 //                                                                    ->setAuthor( $author )
481 481
                                 }
482 482
 
@@ -552,14 +552,14 @@  discard block
 block discarded – undo
552 552
                                             list($year, $month, $day, $hour, $minute, $second) = explode(' ', $dateObj->format('Y m d H i s'));
553 553
                                             $dataValue = \PhpOffice\PhpSpreadsheet\Shared\Date::formattedPHPToExcel($year, $month, $day, $hour, $minute, $second);
554 554
                                             if ($dataValue != floor($dataValue)) {
555
-                                                $formatting = \PhpOffice\PhpSpreadsheet\Style\NumberFormat::FORMAT_DATE_XLSX15.' '.\PhpOffice\PhpSpreadsheet\Style\NumberFormat::FORMAT_DATE_TIME4;
555
+                                                $formatting = \PhpOffice\PhpSpreadsheet\Style\NumberFormat::FORMAT_DATE_XLSX15 . ' ' . \PhpOffice\PhpSpreadsheet\Style\NumberFormat::FORMAT_DATE_TIME4;
556 556
                                             } else {
557 557
                                                 $formatting = \PhpOffice\PhpSpreadsheet\Style\NumberFormat::FORMAT_DATE_XLSX15;
558 558
                                             }
559 559
                                             break;
560 560
                                         case 'time':
561 561
                                             $type = \PhpOffice\PhpSpreadsheet\Cell\DataType::TYPE_NUMERIC;
562
-                                            $dataValue = \PhpOffice\PhpSpreadsheet\Shared\Date::PHPToExcel(strtotime('01-01-1970 '.implode(':', sscanf($cellDataOfficeAttributes['time-value'], 'PT%dH%dM%dS'))));
562
+                                            $dataValue = \PhpOffice\PhpSpreadsheet\Shared\Date::PHPToExcel(strtotime('01-01-1970 ' . implode(':', sscanf($cellDataOfficeAttributes['time-value'], 'PT%dH%dM%dS'))));
563 563
                                             $formatting = \PhpOffice\PhpSpreadsheet\Style\NumberFormat::FORMAT_DATE_TIME4;
564 564
                                             break;
565 565
                                     }
@@ -597,17 +597,17 @@  discard block
 block discarded – undo
597 597
                                         if ($type !== \PhpOffice\PhpSpreadsheet\Cell\DataType::TYPE_NULL) {
598 598
                                             for ($rowAdjust = 0; $rowAdjust < $rowRepeats; ++$rowAdjust) {
599 599
                                                 $rID = $rowID + $rowAdjust;
600
-                                                $spreadsheet->getActiveSheet()->getCell($columnID.$rID)->setValueExplicit((($hasCalculatedValue) ? $cellDataFormula : $dataValue), $type);
600
+                                                $spreadsheet->getActiveSheet()->getCell($columnID . $rID)->setValueExplicit((($hasCalculatedValue) ? $cellDataFormula : $dataValue), $type);
601 601
                                                 if ($hasCalculatedValue) {
602
-                                                    $spreadsheet->getActiveSheet()->getCell($columnID.$rID)->setCalculatedValue($dataValue);
602
+                                                    $spreadsheet->getActiveSheet()->getCell($columnID . $rID)->setCalculatedValue($dataValue);
603 603
                                                 }
604 604
                                                 if ($formatting !== null) {
605
-                                                    $spreadsheet->getActiveSheet()->getStyle($columnID.$rID)->getNumberFormat()->setFormatCode($formatting);
605
+                                                    $spreadsheet->getActiveSheet()->getStyle($columnID . $rID)->getNumberFormat()->setFormatCode($formatting);
606 606
                                                 } else {
607
-                                                    $spreadsheet->getActiveSheet()->getStyle($columnID.$rID)->getNumberFormat()->setFormatCode(\PhpOffice\PhpSpreadsheet\Style\NumberFormat::FORMAT_GENERAL);
607
+                                                    $spreadsheet->getActiveSheet()->getStyle($columnID . $rID)->getNumberFormat()->setFormatCode(\PhpOffice\PhpSpreadsheet\Style\NumberFormat::FORMAT_GENERAL);
608 608
                                                 }
609 609
                                                 if ($hyperlink !== null) {
610
-                                                    $spreadsheet->getActiveSheet()->getCell($columnID.$rID)->getHyperlink()->setUrl($hyperlink);
610
+                                                    $spreadsheet->getActiveSheet()->getCell($columnID . $rID)->getHyperlink()->setUrl($hyperlink);
611 611
                                                 }
612 612
                                             }
613 613
                                         }
@@ -625,7 +625,7 @@  discard block
 block discarded – undo
625 625
                                         if (isset($cellDataTableAttributes['number-rows-spanned'])) {
626 626
                                             $rowTo = $rowTo + $cellDataTableAttributes['number-rows-spanned'] - 1;
627 627
                                         }
628
-                                        $cellRange = $columnID.$rowID.':'.$columnTo.$rowTo;
628
+                                        $cellRange = $columnID . $rowID . ':' . $columnTo . $rowTo;
629 629
                                         $spreadsheet->getActiveSheet()->mergeCells($cellRange);
630 630
                                     }
631 631
                                 }
Please login to merge, or discard this patch.
src/Bootstrap.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -26,6 +26,6 @@
 block discarded – undo
26 26
  *
27 27
  * @version    ##VERSION##, ##DATE##
28 28
  */
29
-include_once __DIR__.'/Autoloader.php';
29
+include_once __DIR__ . '/Autoloader.php';
30 30
 
31 31
 \PhpOffice\PhpSpreadsheet\Autoloader::register();
Please login to merge, or discard this patch.
src/Autoloader.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -56,9 +56,9 @@
 block discarded – undo
56 56
             return false;
57 57
         }
58 58
 
59
-        $classFilePath = __DIR__.DIRECTORY_SEPARATOR.
60
-            'PhpSpreadsheet'.DIRECTORY_SEPARATOR.
61
-            str_replace([$prefix, '\\'], ['', '/'], $className).
59
+        $classFilePath = __DIR__ . DIRECTORY_SEPARATOR .
60
+            'PhpSpreadsheet' . DIRECTORY_SEPARATOR .
61
+            str_replace([$prefix, '\\'], ['', '/'], $className) .
62 62
             '.php';
63 63
 
64 64
         if ((file_exists($classFilePath) === false) || (is_readable($classFilePath) === false)) {
Please login to merge, or discard this patch.