Completed
Pull Request — develop (#47)
by
unknown
10:56
created
src/PhpSpreadsheet/Style/NumberFormat.php 1 patch
Spacing   +14 added lines, -14 removed lines patch added patch discarded remove patch
@@ -390,8 +390,8 @@  discard block
 block discarded – undo
390 390
         }
391 391
 
392 392
         return md5(
393
-            $this->formatCode.
394
-            $this->builtInFormatCode.
393
+            $this->formatCode .
394
+            $this->builtInFormatCode .
395 395
             __CLASS__
396 396
         );
397 397
     }
@@ -465,7 +465,7 @@  discard block
 block discarded – undo
465 465
 
466 466
     private static function escapeQuotesCallback($matches)
467 467
     {
468
-        return '\\'.implode('\\', str_split($matches[1]));
468
+        return '\\' . implode('\\', str_split($matches[1]));
469 469
     }
470 470
 
471 471
     private static function formatAsDate(&$value, &$format)
@@ -506,16 +506,16 @@  discard block
 block discarded – undo
506 506
     private static function formatAsPercentage(&$value, &$format)
507 507
     {
508 508
         if ($format === self::FORMAT_PERCENTAGE) {
509
-            $value = round((100 * $value), 0).'%';
509
+            $value = round((100 * $value), 0) . '%';
510 510
         } else {
511 511
             if (preg_match('/\.[#0]+/i', $format, $m)) {
512
-                $s = substr($m[0], 0, 1).(strlen($m[0]) - 1);
512
+                $s = substr($m[0], 0, 1) . (strlen($m[0]) - 1);
513 513
                 $format = str_replace($m[0], $s, $format);
514 514
             }
515 515
             if (preg_match('/^[#0]+/', $format, $m)) {
516 516
                 $format = str_replace($m[0], strlen($m[0]), $format);
517 517
             }
518
-            $format = '%'.str_replace('%', 'f%%', $format);
518
+            $format = '%' . str_replace('%', 'f%%', $format);
519 519
 
520 520
             $value = sprintf($format, 100 * $value);
521 521
         }
@@ -551,12 +551,12 @@  discard block
 block discarded – undo
551 551
         $sign = ($number < 0.0);
552 552
         $number = abs($number);
553 553
         if (strpos($mask, '.') !== false) {
554
-            $numbers = explode('.', $number.'.0');
555
-            $masks = explode('.', $mask.'.0');
554
+            $numbers = explode('.', $number . '.0');
555
+            $masks = explode('.', $mask . '.0');
556 556
             $result1 = self::complexNumberFormatMask($numbers[0], $masks[0], 1);
557 557
             $result2 = strrev(self::complexNumberFormatMask(strrev($numbers[1]), strrev($masks[1]), 1));
558 558
 
559
-            return (($sign) ? '-' : '').$result1.'.'.$result2;
559
+            return (($sign) ? '-' : '') . $result1 . '.' . $result2;
560 560
         }
561 561
 
562 562
         $r = preg_match_all('/0+/', $mask, $result, PREG_OFFSET_CAPTURE);
@@ -564,12 +564,12 @@  discard block
 block discarded – undo
564 564
             $result = array_reverse($result[0]);
565 565
 
566 566
             foreach ($result as $block) {
567
-                $divisor = 1 .$block[0];
567
+                $divisor = 1 . $block[0];
568 568
                 $size = strlen($block[0]);
569 569
                 $offset = $block[1];
570 570
 
571 571
                 $blockValue = sprintf(
572
-                    '%0'.$size.'d',
572
+                    '%0' . $size . 'd',
573 573
                     fmod($number, $divisor)
574 574
                 );
575 575
                 $number = floor($number / $divisor);
@@ -583,7 +583,7 @@  discard block
 block discarded – undo
583 583
             $result = $number;
584 584
         }
585 585
 
586
-        return (($sign) ? '-' : '').$result;
586
+        return (($sign) ? '-' : '') . $result;
587 587
     }
588 588
 
589 589
     /**
@@ -669,7 +669,7 @@  discard block
 block discarded – undo
669 669
             self::formatAsPercentage($value, $format);
670 670
         } else {
671 671
             if ($format === self::FORMAT_CURRENCY_EUR_SIMPLE) {
672
-                $value = 'EUR '.sprintf('%1.2f', $value);
672
+                $value = 'EUR ' . sprintf('%1.2f', $value);
673 673
             } else {
674 674
                 // Some non-number strings are quoted, so we'll get rid of the quotes, likewise any positional * symbols
675 675
                 $format = str_replace(['"', '*'], '', $format);
@@ -734,7 +734,7 @@  discard block
 block discarded – undo
734 734
                             } elseif (preg_match('/0([^\d\.]+)0/', $format)) {
735 735
                                 $value = self::complexNumberFormatMask($value, $format);
736 736
                             } else {
737
-                                $sprintf_pattern = "%0$minWidth.".strlen($right).'f';
737
+                                $sprintf_pattern = "%0$minWidth." . strlen($right) . 'f';
738 738
                                 $value = sprintf($sprintf_pattern, $value);
739 739
                                 $value = preg_replace($number_regex, $value, $format);
740 740
                             }
Please login to merge, or discard this patch.
src/PhpSpreadsheet/Style/Conditional.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -277,10 +277,10 @@
 block discarded – undo
277 277
     public function getHashCode()
278 278
     {
279 279
         return md5(
280
-            $this->conditionType.
281
-            $this->operatorType.
282
-            implode(';', $this->condition).
283
-            $this->style->getHashCode().
280
+            $this->conditionType .
281
+            $this->operatorType .
282
+            implode(';', $this->condition) .
283
+            $this->style->getHashCode() .
284 284
             __CLASS__
285 285
         );
286 286
     }
Please login to merge, or discard this patch.
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/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.