Completed
Pull Request — develop (#47)
by
unknown
10:56
created
src/PhpSpreadsheet/Style/Protection.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -208,8 +208,8 @@
 block discarded – undo
208 208
         }
209 209
 
210 210
         return md5(
211
-            $this->locked.
212
-            $this->hidden.
211
+            $this->locked .
212
+            $this->hidden .
213 213
             __CLASS__
214 214
         );
215 215
     }
Please login to merge, or discard this patch.
src/PhpSpreadsheet/Style/Color.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -237,10 +237,10 @@  discard block
 block discarded – undo
237 237
             $pValue = '000000';
238 238
         }
239 239
         if ($this->isSupervisor) {
240
-            $styleArray = $this->getStyleArray(['argb' => 'FF'.$pValue]);
240
+            $styleArray = $this->getStyleArray(['argb' => 'FF' . $pValue]);
241 241
             $this->getActiveSheet()->getStyle($this->getSelectedCells())->applyFromArray($styleArray);
242 242
         } else {
243
-            $this->argb = 'FF'.$pValue;
243
+            $this->argb = 'FF' . $pValue;
244 244
         }
245 245
 
246 246
         return $this;
@@ -352,12 +352,12 @@  discard block
 block discarded – undo
352 352
         }
353 353
 
354 354
         $rgb = strtoupper(
355
-            str_pad(dechex($red), 2, '0', 0).
356
-            str_pad(dechex($green), 2, '0', 0).
355
+            str_pad(dechex($red), 2, '0', 0) .
356
+            str_pad(dechex($green), 2, '0', 0) .
357 357
             str_pad(dechex($blue), 2, '0', 0)
358 358
         );
359 359
 
360
-        return (($rgba) ? 'FF' : '').$rgb;
360
+        return (($rgba) ? 'FF' : '') . $rgb;
361 361
     }
362 362
 
363 363
     /**
@@ -459,7 +459,7 @@  discard block
 block discarded – undo
459 459
         }
460 460
 
461 461
         return md5(
462
-            $this->argb.
462
+            $this->argb .
463 463
             __CLASS__
464 464
         );
465 465
     }
Please login to merge, or discard this patch.
src/PhpSpreadsheet/Style/Borders.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -436,12 +436,12 @@
 block discarded – undo
436 436
         }
437 437
 
438 438
         return md5(
439
-            $this->getLeft()->getHashCode().
440
-            $this->getRight()->getHashCode().
441
-            $this->getTop()->getHashCode().
442
-            $this->getBottom()->getHashCode().
443
-            $this->getDiagonal()->getHashCode().
444
-            $this->getDiagonalDirection().
439
+            $this->getLeft()->getHashCode() .
440
+            $this->getRight()->getHashCode() .
441
+            $this->getTop()->getHashCode() .
442
+            $this->getBottom()->getHashCode() .
443
+            $this->getDiagonal()->getHashCode() .
444
+            $this->getDiagonalDirection() .
445 445
             __CLASS__
446 446
         );
447 447
     }
Please login to merge, or discard this patch.
src/PhpSpreadsheet/Style/Border.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -289,8 +289,8 @@
 block discarded – undo
289 289
         }
290 290
 
291 291
         return md5(
292
-            $this->borderStyle.
293
-            $this->color->getHashCode().
292
+            $this->borderStyle .
293
+            $this->color->getHashCode() .
294 294
             __CLASS__
295 295
         );
296 296
     }
Please login to merge, or discard this patch.
src/PhpSpreadsheet/Style/Font.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -561,15 +561,15 @@
 block discarded – undo
561 561
         }
562 562
 
563 563
         return md5(
564
-            $this->name.
565
-            $this->size.
566
-            ($this->bold ? 't' : 'f').
567
-            ($this->italic ? 't' : 'f').
568
-            ($this->superScript ? 't' : 'f').
569
-            ($this->subScript ? 't' : 'f').
570
-            $this->underline.
571
-            ($this->strikethrough ? 't' : 'f').
572
-            $this->color->getHashCode().
564
+            $this->name .
565
+            $this->size .
566
+            ($this->bold ? 't' : 'f') .
567
+            ($this->italic ? 't' : 'f') .
568
+            ($this->superScript ? 't' : 'f') .
569
+            ($this->subScript ? 't' : 'f') .
570
+            $this->underline .
571
+            ($this->strikethrough ? 't' : 'f') .
572
+            $this->color->getHashCode() .
573 573
             __CLASS__
574 574
         );
575 575
     }
Please login to merge, or discard this patch.
src/PhpSpreadsheet/Style/Alignment.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -479,13 +479,13 @@
 block discarded – undo
479 479
         }
480 480
 
481 481
         return md5(
482
-            $this->horizontal.
483
-            $this->vertical.
484
-            $this->textRotation.
485
-            ($this->wrapText ? 't' : 'f').
486
-            ($this->shrinkToFit ? 't' : 'f').
487
-            $this->indent.
488
-            $this->readorder.
482
+            $this->horizontal .
483
+            $this->vertical .
484
+            $this->textRotation .
485
+            ($this->wrapText ? 't' : 'f') .
486
+            ($this->shrinkToFit ? 't' : 'f') .
487
+            $this->indent .
488
+            $this->readorder .
489 489
             __CLASS__
490 490
         );
491 491
     }
Please login to merge, or discard this patch.
src/PhpSpreadsheet/CachedObjectStorageFactory.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -153,7 +153,7 @@  discard block
 block discarded – undo
153 153
     {
154 154
         $activeMethods = [];
155 155
         foreach (self::$storageMethods as $storageMethod) {
156
-            $cacheStorageClass = '\\PhpOffice\\PhpSpreadsheet\\CachedObjectStorage\\'.$storageMethod;
156
+            $cacheStorageClass = '\\PhpOffice\\PhpSpreadsheet\\CachedObjectStorage\\' . $storageMethod;
157 157
             if (call_user_func([$cacheStorageClass, 'cacheMethodIsAvailable'])) {
158 158
                 $activeMethods[] = $storageMethod;
159 159
             }
@@ -177,7 +177,7 @@  discard block
 block discarded – undo
177 177
             return false;
178 178
         }
179 179
 
180
-        $cacheStorageClass = '\\PhpOffice\\PhpSpreadsheet\\CachedObjectStorage\\'.$method;
180
+        $cacheStorageClass = '\\PhpOffice\\PhpSpreadsheet\\CachedObjectStorage\\' . $method;
181 181
         if (!call_user_func([$cacheStorageClass, 'cacheMethodIsAvailable'])) {
182 182
             return false;
183 183
         }
@@ -190,7 +190,7 @@  discard block
 block discarded – undo
190 190
         }
191 191
 
192 192
         if (self::$cacheStorageMethod === null) {
193
-            self::$cacheStorageClass = '\\PhpOffice\\PhpSpreadsheet\\CachedObjectStorage\\'.$method;
193
+            self::$cacheStorageClass = '\\PhpOffice\\PhpSpreadsheet\\CachedObjectStorage\\' . $method;
194 194
             self::$cacheStorageMethod = $method;
195 195
         }
196 196
 
Please login to merge, or discard this patch.
src/PhpSpreadsheet/ReferenceHelper.php 1 patch
Spacing   +52 added lines, -52 removed lines patch added patch discarded remove patch
@@ -77,7 +77,7 @@  discard block
 block discarded – undo
77 77
      */
78 78
     public static function columnSort($a, $b)
79 79
     {
80
-        return strcasecmp(strlen($a).$a, strlen($b).$b);
80
+        return strcasecmp(strlen($a) . $a, strlen($b) . $b);
81 81
     }
82 82
 
83 83
     /**
@@ -91,7 +91,7 @@  discard block
 block discarded – undo
91 91
      */
92 92
     public static function columnReverseSort($a, $b)
93 93
     {
94
-        return 1 - strcasecmp(strlen($a).$a, strlen($b).$b);
94
+        return 1 - strcasecmp(strlen($a) . $a, strlen($b) . $b);
95 95
     }
96 96
 
97 97
     /**
@@ -109,7 +109,7 @@  discard block
 block discarded – undo
109 109
         sscanf($b, '%[A-Z]%d', $bc, $br);
110 110
 
111 111
         if ($ar == $br) {
112
-            return strcasecmp(strlen($ac).$ac, strlen($bc).$bc);
112
+            return strcasecmp(strlen($ac) . $ac, strlen($bc) . $bc);
113 113
         }
114 114
 
115 115
         return ($ar < $br) ? -1 : 1;
@@ -130,7 +130,7 @@  discard block
 block discarded – undo
130 130
         sscanf($b, '%[A-Z]%d', $bc, $br);
131 131
 
132 132
         if ($ar == $br) {
133
-            return 1 - strcasecmp(strlen($ac).$ac, strlen($bc).$bc);
133
+            return 1 - strcasecmp(strlen($ac) . $ac, strlen($bc) . $bc);
134 134
         }
135 135
 
136 136
         return ($ar < $br) ? 1 : -1;
@@ -335,7 +335,7 @@  discard block
 block discarded – undo
335 335
         $aColumnDimensions = array_reverse($pSheet->getColumnDimensions(), true);
336 336
         if (!empty($aColumnDimensions)) {
337 337
             foreach ($aColumnDimensions as $objColumnDimension) {
338
-                $newReference = $this->updateCellReference($objColumnDimension->getColumnIndex().'1', $pBefore, $pNumCols, $pNumRows);
338
+                $newReference = $this->updateCellReference($objColumnDimension->getColumnIndex() . '1', $pBefore, $pNumCols, $pNumRows);
339 339
                 list($newReference) = Cell::coordinateFromString($newReference);
340 340
                 if ($objColumnDimension->getColumnIndex() != $newReference) {
341 341
                     $objColumnDimension->setColumnIndex($newReference);
@@ -360,7 +360,7 @@  discard block
 block discarded – undo
360 360
         $aRowDimensions = array_reverse($pSheet->getRowDimensions(), true);
361 361
         if (!empty($aRowDimensions)) {
362 362
             foreach ($aRowDimensions as $objRowDimension) {
363
-                $newReference = $this->updateCellReference('A'.$objRowDimension->getRowIndex(), $pBefore, $pNumCols, $pNumRows);
363
+                $newReference = $this->updateCellReference('A' . $objRowDimension->getRowIndex(), $pBefore, $pNumCols, $pNumRows);
364 364
                 list(, $newReference) = Cell::coordinateFromString($newReference);
365 365
                 if ($objRowDimension->getRowIndex() != $newReference) {
366 366
                     $objRowDimension->setRowIndex($newReference);
@@ -408,7 +408,7 @@  discard block
 block discarded – undo
408 408
         if ($pNumCols < 0 && $beforeColumnIndex - 2 + $pNumCols > 0) {
409 409
             for ($i = 1; $i <= $highestRow - 1; ++$i) {
410 410
                 for ($j = $beforeColumnIndex - 1 + $pNumCols; $j <= $beforeColumnIndex - 2; ++$j) {
411
-                    $coordinate = Cell::stringFromColumnIndex($j).$i;
411
+                    $coordinate = Cell::stringFromColumnIndex($j) . $i;
412 412
                     $pSheet->removeConditionalStyles($coordinate);
413 413
                     if ($pSheet->cellExists($coordinate)) {
414 414
                         $pSheet->getCell($coordinate)->setValueExplicit('', DataType::TYPE_NULL);
@@ -422,7 +422,7 @@  discard block
 block discarded – undo
422 422
         if ($pNumRows < 0 && $beforeRow - 1 + $pNumRows > 0) {
423 423
             for ($i = $beforeColumnIndex - 1; $i <= Cell::columnIndexFromString($highestColumn) - 1; ++$i) {
424 424
                 for ($j = $beforeRow + $pNumRows; $j <= $beforeRow - 1; ++$j) {
425
-                    $coordinate = Cell::stringFromColumnIndex($i).$j;
425
+                    $coordinate = Cell::stringFromColumnIndex($i) . $j;
426 426
                     $pSheet->removeConditionalStyles($coordinate);
427 427
                     if ($pSheet->cellExists($coordinate)) {
428 428
                         $pSheet->getCell($coordinate)->setValueExplicit('', DataType::TYPE_NULL);
@@ -446,7 +446,7 @@  discard block
 block discarded – undo
446 446
             }
447 447
 
448 448
             // New coordinates
449
-            $newCoordinates = Cell::stringFromColumnIndex($cellIndex - 1 + $pNumCols).($cell->getRow() + $pNumRows);
449
+            $newCoordinates = Cell::stringFromColumnIndex($cellIndex - 1 + $pNumCols) . ($cell->getRow() + $pNumRows);
450 450
 
451 451
             // Should the cell be updated? Move value and cellXf index from one cell to another.
452 452
             if (($cellIndex >= $beforeColumnIndex) && ($cell->getRow() >= $beforeRow)) {
@@ -482,7 +482,7 @@  discard block
 block discarded – undo
482 482
         if ($pNumCols > 0 && $beforeColumnIndex - 2 > 0) {
483 483
             for ($i = $beforeRow; $i <= $highestRow - 1; ++$i) {
484 484
                 // Style
485
-                $coordinate = Cell::stringFromColumnIndex($beforeColumnIndex - 2).$i;
485
+                $coordinate = Cell::stringFromColumnIndex($beforeColumnIndex - 2) . $i;
486 486
                 if ($pSheet->cellExists($coordinate)) {
487 487
                     $xfIndex = $pSheet->getCell($coordinate)->getXfIndex();
488 488
                     $conditionalStyles = $pSheet->conditionalStylesExists($coordinate) ?
@@ -494,7 +494,7 @@  discard block
 block discarded – undo
494 494
                             foreach ($conditionalStyles as $conditionalStyle) {
495 495
                                 $cloned[] = clone $conditionalStyle;
496 496
                             }
497
-                            $pSheet->setConditionalStyles(Cell::stringFromColumnIndex($j).$i, $cloned);
497
+                            $pSheet->setConditionalStyles(Cell::stringFromColumnIndex($j) . $i, $cloned);
498 498
                         }
499 499
                     }
500 500
                 }
@@ -504,19 +504,19 @@  discard block
 block discarded – undo
504 504
         if ($pNumRows > 0 && $beforeRow - 1 > 0) {
505 505
             for ($i = $beforeColumnIndex - 1; $i <= Cell::columnIndexFromString($highestColumn) - 1; ++$i) {
506 506
                 // Style
507
-                $coordinate = Cell::stringFromColumnIndex($i).($beforeRow - 1);
507
+                $coordinate = Cell::stringFromColumnIndex($i) . ($beforeRow - 1);
508 508
                 if ($pSheet->cellExists($coordinate)) {
509 509
                     $xfIndex = $pSheet->getCell($coordinate)->getXfIndex();
510 510
                     $conditionalStyles = $pSheet->conditionalStylesExists($coordinate) ?
511 511
                         $pSheet->getConditionalStyles($coordinate) : false;
512 512
                     for ($j = $beforeRow; $j <= $beforeRow - 1 + $pNumRows; ++$j) {
513
-                        $pSheet->getCell(Cell::stringFromColumnIndex($i).$j)->setXfIndex($xfIndex);
513
+                        $pSheet->getCell(Cell::stringFromColumnIndex($i) . $j)->setXfIndex($xfIndex);
514 514
                         if ($conditionalStyles) {
515 515
                             $cloned = [];
516 516
                             foreach ($conditionalStyles as $conditionalStyle) {
517 517
                                 $cloned[] = clone $conditionalStyle;
518 518
                             }
519
-                            $pSheet->setConditionalStyles(Cell::stringFromColumnIndex($i).$j, $cloned);
519
+                            $pSheet->setConditionalStyles(Cell::stringFromColumnIndex($i) . $j, $cloned);
520 520
                         }
521 521
                     }
522 522
                 }
@@ -661,102 +661,102 @@  discard block
 block discarded – undo
661 661
                 $adjustCount = 0;
662 662
                 $newCellTokens = $cellTokens = [];
663 663
                 //    Search for row ranges (e.g. 'Sheet1'!3:5 or 3:5) with or without $ absolutes (e.g. $3:5)
664
-                $matchCount = preg_match_all('/'.self::REFHELPER_REGEXP_ROWRANGE.'/i', ' '.$formulaBlock.' ', $matches, PREG_SET_ORDER);
664
+                $matchCount = preg_match_all('/' . self::REFHELPER_REGEXP_ROWRANGE . '/i', ' ' . $formulaBlock . ' ', $matches, PREG_SET_ORDER);
665 665
                 if ($matchCount > 0) {
666 666
                     foreach ($matches as $match) {
667
-                        $fromString = ($match[2] > '') ? $match[2].'!' : '';
668
-                        $fromString .= $match[3].':'.$match[4];
669
-                        $modified3 = substr($this->updateCellReference('$A'.$match[3], $pBefore, $pNumCols, $pNumRows), 2);
670
-                        $modified4 = substr($this->updateCellReference('$A'.$match[4], $pBefore, $pNumCols, $pNumRows), 2);
667
+                        $fromString = ($match[2] > '') ? $match[2] . '!' : '';
668
+                        $fromString .= $match[3] . ':' . $match[4];
669
+                        $modified3 = substr($this->updateCellReference('$A' . $match[3], $pBefore, $pNumCols, $pNumRows), 2);
670
+                        $modified4 = substr($this->updateCellReference('$A' . $match[4], $pBefore, $pNumCols, $pNumRows), 2);
671 671
 
672
-                        if ($match[3].':'.$match[4] !== $modified3.':'.$modified4) {
672
+                        if ($match[3] . ':' . $match[4] !== $modified3 . ':' . $modified4) {
673 673
                             if (($match[2] == '') || (trim($match[2], "'") == $sheetName)) {
674
-                                $toString = ($match[2] > '') ? $match[2].'!' : '';
675
-                                $toString .= $modified3.':'.$modified4;
674
+                                $toString = ($match[2] > '') ? $match[2] . '!' : '';
675
+                                $toString .= $modified3 . ':' . $modified4;
676 676
                                 //    Max worksheet size is 1,048,576 rows by 16,384 columns in Excel 2007, so our adjustments need to be at least one digit more
677 677
                                 $column = 100000;
678 678
                                 $row = 10000000 + trim($match[3], '$');
679
-                                $cellIndex = $column.$row;
679
+                                $cellIndex = $column . $row;
680 680
 
681 681
                                 $newCellTokens[$cellIndex] = preg_quote($toString);
682
-                                $cellTokens[$cellIndex] = '/(?<!\d\$\!)'.preg_quote($fromString).'(?!\d)/i';
682
+                                $cellTokens[$cellIndex] = '/(?<!\d\$\!)' . preg_quote($fromString) . '(?!\d)/i';
683 683
                                 ++$adjustCount;
684 684
                             }
685 685
                         }
686 686
                     }
687 687
                 }
688 688
                 //    Search for column ranges (e.g. 'Sheet1'!C:E or C:E) with or without $ absolutes (e.g. $C:E)
689
-                $matchCount = preg_match_all('/'.self::REFHELPER_REGEXP_COLRANGE.'/i', ' '.$formulaBlock.' ', $matches, PREG_SET_ORDER);
689
+                $matchCount = preg_match_all('/' . self::REFHELPER_REGEXP_COLRANGE . '/i', ' ' . $formulaBlock . ' ', $matches, PREG_SET_ORDER);
690 690
                 if ($matchCount > 0) {
691 691
                     foreach ($matches as $match) {
692
-                        $fromString = ($match[2] > '') ? $match[2].'!' : '';
693
-                        $fromString .= $match[3].':'.$match[4];
694
-                        $modified3 = substr($this->updateCellReference($match[3].'$1', $pBefore, $pNumCols, $pNumRows), 0, -2);
695
-                        $modified4 = substr($this->updateCellReference($match[4].'$1', $pBefore, $pNumCols, $pNumRows), 0, -2);
692
+                        $fromString = ($match[2] > '') ? $match[2] . '!' : '';
693
+                        $fromString .= $match[3] . ':' . $match[4];
694
+                        $modified3 = substr($this->updateCellReference($match[3] . '$1', $pBefore, $pNumCols, $pNumRows), 0, -2);
695
+                        $modified4 = substr($this->updateCellReference($match[4] . '$1', $pBefore, $pNumCols, $pNumRows), 0, -2);
696 696
 
697
-                        if ($match[3].':'.$match[4] !== $modified3.':'.$modified4) {
697
+                        if ($match[3] . ':' . $match[4] !== $modified3 . ':' . $modified4) {
698 698
                             if (($match[2] == '') || (trim($match[2], "'") == $sheetName)) {
699
-                                $toString = ($match[2] > '') ? $match[2].'!' : '';
700
-                                $toString .= $modified3.':'.$modified4;
699
+                                $toString = ($match[2] > '') ? $match[2] . '!' : '';
700
+                                $toString .= $modified3 . ':' . $modified4;
701 701
                                 //    Max worksheet size is 1,048,576 rows by 16,384 columns in Excel 2007, so our adjustments need to be at least one digit more
702 702
                                 $column = Cell::columnIndexFromString(trim($match[3], '$')) + 100000;
703 703
                                 $row = 10000000;
704
-                                $cellIndex = $column.$row;
704
+                                $cellIndex = $column . $row;
705 705
 
706 706
                                 $newCellTokens[$cellIndex] = preg_quote($toString);
707
-                                $cellTokens[$cellIndex] = '/(?<![A-Z\$\!])'.preg_quote($fromString).'(?![A-Z])/i';
707
+                                $cellTokens[$cellIndex] = '/(?<![A-Z\$\!])' . preg_quote($fromString) . '(?![A-Z])/i';
708 708
                                 ++$adjustCount;
709 709
                             }
710 710
                         }
711 711
                     }
712 712
                 }
713 713
                 //    Search for cell ranges (e.g. 'Sheet1'!A3:C5 or A3:C5) with or without $ absolutes (e.g. $A1:C$5)
714
-                $matchCount = preg_match_all('/'.self::REFHELPER_REGEXP_CELLRANGE.'/i', ' '.$formulaBlock.' ', $matches, PREG_SET_ORDER);
714
+                $matchCount = preg_match_all('/' . self::REFHELPER_REGEXP_CELLRANGE . '/i', ' ' . $formulaBlock . ' ', $matches, PREG_SET_ORDER);
715 715
                 if ($matchCount > 0) {
716 716
                     foreach ($matches as $match) {
717
-                        $fromString = ($match[2] > '') ? $match[2].'!' : '';
718
-                        $fromString .= $match[3].':'.$match[4];
717
+                        $fromString = ($match[2] > '') ? $match[2] . '!' : '';
718
+                        $fromString .= $match[3] . ':' . $match[4];
719 719
                         $modified3 = $this->updateCellReference($match[3], $pBefore, $pNumCols, $pNumRows);
720 720
                         $modified4 = $this->updateCellReference($match[4], $pBefore, $pNumCols, $pNumRows);
721 721
 
722
-                        if ($match[3].$match[4] !== $modified3.$modified4) {
722
+                        if ($match[3] . $match[4] !== $modified3 . $modified4) {
723 723
                             if (($match[2] == '') || (trim($match[2], "'") == $sheetName)) {
724
-                                $toString = ($match[2] > '') ? $match[2].'!' : '';
725
-                                $toString .= $modified3.':'.$modified4;
724
+                                $toString = ($match[2] > '') ? $match[2] . '!' : '';
725
+                                $toString .= $modified3 . ':' . $modified4;
726 726
                                 list($column, $row) = Cell::coordinateFromString($match[3]);
727 727
                                 //    Max worksheet size is 1,048,576 rows by 16,384 columns in Excel 2007, so our adjustments need to be at least one digit more
728 728
                                 $column = Cell::columnIndexFromString(trim($column, '$')) + 100000;
729 729
                                 $row = trim($row, '$') + 10000000;
730
-                                $cellIndex = $column.$row;
730
+                                $cellIndex = $column . $row;
731 731
 
732 732
                                 $newCellTokens[$cellIndex] = preg_quote($toString);
733
-                                $cellTokens[$cellIndex] = '/(?<![A-Z]\$\!)'.preg_quote($fromString).'(?!\d)/i';
733
+                                $cellTokens[$cellIndex] = '/(?<![A-Z]\$\!)' . preg_quote($fromString) . '(?!\d)/i';
734 734
                                 ++$adjustCount;
735 735
                             }
736 736
                         }
737 737
                     }
738 738
                 }
739 739
                 //    Search for cell references (e.g. 'Sheet1'!A3 or C5) with or without $ absolutes (e.g. $A1 or C$5)
740
-                $matchCount = preg_match_all('/'.self::REFHELPER_REGEXP_CELLREF.'/i', ' '.$formulaBlock.' ', $matches, PREG_SET_ORDER);
740
+                $matchCount = preg_match_all('/' . self::REFHELPER_REGEXP_CELLREF . '/i', ' ' . $formulaBlock . ' ', $matches, PREG_SET_ORDER);
741 741
 
742 742
                 if ($matchCount > 0) {
743 743
                     foreach ($matches as $match) {
744
-                        $fromString = ($match[2] > '') ? $match[2].'!' : '';
744
+                        $fromString = ($match[2] > '') ? $match[2] . '!' : '';
745 745
                         $fromString .= $match[3];
746 746
 
747 747
                         $modified3 = $this->updateCellReference($match[3], $pBefore, $pNumCols, $pNumRows);
748 748
                         if ($match[3] !== $modified3) {
749 749
                             if (($match[2] == '') || (trim($match[2], "'") == $sheetName)) {
750
-                                $toString = ($match[2] > '') ? $match[2].'!' : '';
750
+                                $toString = ($match[2] > '') ? $match[2] . '!' : '';
751 751
                                 $toString .= $modified3;
752 752
                                 list($column, $row) = Cell::coordinateFromString($match[3]);
753 753
                                 //    Max worksheet size is 1,048,576 rows by 16,384 columns in Excel 2007, so our adjustments need to be at least one digit more
754 754
                                 $column = Cell::columnIndexFromString(trim($column, '$')) + 100000;
755 755
                                 $row = trim($row, '$') + 10000000;
756
-                                $cellIndex = $row.$column;
756
+                                $cellIndex = $row . $column;
757 757
 
758 758
                                 $newCellTokens[$cellIndex] = preg_quote($toString);
759
-                                $cellTokens[$cellIndex] = '/(?<![A-Z\$\!])'.preg_quote($fromString).'(?!\d)/i';
759
+                                $cellTokens[$cellIndex] = '/(?<![A-Z\$\!])' . preg_quote($fromString) . '(?!\d)/i';
760 760
                                 ++$adjustCount;
761 761
                             }
762 762
                         }
@@ -829,8 +829,8 @@  discard block
 block discarded – undo
829 829
                 if (($cell !== null) && ($cell->getDataType() == DataType::TYPE_FORMULA)) {
830 830
                     $formula = $cell->getValue();
831 831
                     if (strpos($formula, $oldName) !== false) {
832
-                        $formula = str_replace("'".$oldName."'!", "'".$newName."'!", $formula);
833
-                        $formula = str_replace($oldName.'!', $newName.'!', $formula);
832
+                        $formula = str_replace("'" . $oldName . "'!", "'" . $newName . "'!", $formula);
833
+                        $formula = str_replace($oldName . '!', $newName . '!', $formula);
834 834
                         $cell->setValueExplicit($formula, DataType::TYPE_FORMULA);
835 835
                     }
836 836
                 }
@@ -860,10 +860,10 @@  discard block
 block discarded – undo
860 860
                 $jc = count($range[$i]);
861 861
                 for ($j = 0; $j < $jc; ++$j) {
862 862
                     if (ctype_alpha($range[$i][$j])) {
863
-                        $r = Cell::coordinateFromString($this->updateSingleCellReference($range[$i][$j].'1', $pBefore, $pNumCols, $pNumRows));
863
+                        $r = Cell::coordinateFromString($this->updateSingleCellReference($range[$i][$j] . '1', $pBefore, $pNumCols, $pNumRows));
864 864
                         $range[$i][$j] = $r[0];
865 865
                     } elseif (ctype_digit($range[$i][$j])) {
866
-                        $r = Cell::coordinateFromString($this->updateSingleCellReference('A'.$range[$i][$j], $pBefore, $pNumCols, $pNumRows));
866
+                        $r = Cell::coordinateFromString($this->updateSingleCellReference('A' . $range[$i][$j], $pBefore, $pNumCols, $pNumRows));
867 867
                         $range[$i][$j] = $r[1];
868 868
                     } else {
869 869
                         $range[$i][$j] = $this->updateSingleCellReference($range[$i][$j], $pBefore, $pNumCols, $pNumRows);
@@ -914,7 +914,7 @@  discard block
 block discarded – undo
914 914
             }
915 915
 
916 916
             // Return new reference
917
-            return $newColumn.$newRow;
917
+            return $newColumn . $newRow;
918 918
         } else {
919 919
             throw new Exception('Only single cell references may be passed to this method.');
920 920
         }
Please login to merge, or discard this patch.
src/PhpSpreadsheet/Cell.php 1 patch
Spacing   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -259,7 +259,7 @@  discard block
 block discarded – undo
259 259
                 $this->value = DataType::checkErrorCode($pValue);
260 260
                 break;
261 261
             default:
262
-                throw new Exception('Invalid datatype: '.$pDataType);
262
+                throw new Exception('Invalid datatype: ' . $pDataType);
263 263
                 break;
264 264
         }
265 265
 
@@ -299,7 +299,7 @@  discard block
 block discarded – undo
299 299
                 }
300 300
                 $result = '#N/A';
301 301
                 throw new Exception(
302
-                    $this->getWorksheet()->getTitle().'!'.$this->getCoordinate().' -> '.$ex->getMessage()
302
+                    $this->getWorksheet()->getTitle() . '!' . $this->getCoordinate() . ' -> ' . $ex->getMessage()
303 303
                 );
304 304
             }
305 305
 
@@ -614,7 +614,7 @@  discard block
 block discarded – undo
614 614
             throw new Exception('Cell coordinate can not be zero-length string');
615 615
         }
616 616
 
617
-        throw new Exception('Invalid cell coordinate '.$pCoordinateString);
617
+        throw new Exception('Invalid cell coordinate ' . $pCoordinateString);
618 618
     }
619 619
 
620 620
     /**
@@ -642,12 +642,12 @@  discard block
 block discarded – undo
642 642
 
643 643
             // Create absolute coordinate
644 644
             if (ctype_digit($pCoordinateString)) {
645
-                return $worksheet.'$'.$pCoordinateString;
645
+                return $worksheet . '$' . $pCoordinateString;
646 646
             } elseif (ctype_alpha($pCoordinateString)) {
647
-                return $worksheet.'$'.strtoupper($pCoordinateString);
647
+                return $worksheet . '$' . strtoupper($pCoordinateString);
648 648
             }
649 649
 
650
-            return $worksheet.self::absoluteCoordinate($pCoordinateString);
650
+            return $worksheet . self::absoluteCoordinate($pCoordinateString);
651 651
         }
652 652
 
653 653
         throw new Exception('Cell coordinate string can not be a range of cells');
@@ -680,7 +680,7 @@  discard block
 block discarded – undo
680 680
             $column = ltrim($column, '$');
681 681
             $row = ltrim($row, '$');
682 682
 
683
-            return $worksheet.'$'.$column.'$'.$row;
683
+            return $worksheet . '$' . $column . '$' . $row;
684 684
         }
685 685
 
686 686
         throw new Exception('Cell coordinate string can not be a range of cells');
@@ -861,7 +861,7 @@  discard block
 block discarded – undo
861 861
                 return $_indexCache[$pString];
862 862
             }
863 863
         }
864
-        throw new Exception('Column string index can not be '.((isset($pString{0})) ? 'longer than 3 characters' : 'empty'));
864
+        throw new Exception('Column string index can not be ' . ((isset($pString{0})) ? 'longer than 3 characters' : 'empty'));
865 865
     }
866 866
 
867 867
     /**
@@ -883,11 +883,11 @@  discard block
 block discarded – undo
883 883
             if ($pColumnIndex < 26) {
884 884
                 $_indexCache[$pColumnIndex] = chr(65 + $pColumnIndex);
885 885
             } elseif ($pColumnIndex < 702) {
886
-                $_indexCache[$pColumnIndex] = chr(64 + ($pColumnIndex / 26)).
886
+                $_indexCache[$pColumnIndex] = chr(64 + ($pColumnIndex / 26)) .
887 887
                                                 chr(65 + $pColumnIndex % 26);
888 888
             } else {
889
-                $_indexCache[$pColumnIndex] = chr(64 + (($pColumnIndex - 26) / 676)).
890
-                                                chr(65 + ((($pColumnIndex - 26) % 676) / 26)).
889
+                $_indexCache[$pColumnIndex] = chr(64 + (($pColumnIndex - 26) / 676)) .
890
+                                                chr(65 + ((($pColumnIndex - 26) % 676) / 26)) .
891 891
                                                 chr(65 + $pColumnIndex % 26);
892 892
             }
893 893
         }
@@ -938,7 +938,7 @@  discard block
 block discarded – undo
938 938
                 // Loop cells
939 939
                 while ($currentCol != $endCol) {
940 940
                     while ($currentRow <= $endRow) {
941
-                        $returnValue[] = $currentCol.$currentRow;
941
+                        $returnValue[] = $currentCol . $currentRow;
942 942
                         ++$currentRow;
943 943
                     }
944 944
                     ++$currentCol;
Please login to merge, or discard this patch.