Completed
Pull Request — develop (#47)
by
unknown
10:56
created
src/PhpSpreadsheet/Calculation/Statistical.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -874,7 +874,7 @@  discard block
 block discarded – undo
874 874
             if (!is_numeric($arg)) {
875 875
                 $arg = \PhpOffice\PhpSpreadsheet\Calculation::wrapResult(strtoupper($arg));
876 876
             }
877
-            $testCondition = '='.$arg.$condition;
877
+            $testCondition = '=' . $arg . $condition;
878 878
             if (\PhpOffice\PhpSpreadsheet\Calculation::getInstance()->_calculateFormulaValue($testCondition)) {
879 879
                 if ((is_null($returnValue)) || ($arg > $returnValue)) {
880 880
                     $returnValue += $arg;
@@ -1304,7 +1304,7 @@  discard block
 block discarded – undo
1304 1304
             if (!is_numeric($arg)) {
1305 1305
                 $arg = \PhpOffice\PhpSpreadsheet\Calculation::wrapResult(strtoupper($arg));
1306 1306
             }
1307
-            $testCondition = '='.$arg.$condition;
1307
+            $testCondition = '=' . $arg . $condition;
1308 1308
             if (\PhpOffice\PhpSpreadsheet\Calculation::getInstance()->_calculateFormulaValue($testCondition)) {
1309 1309
                 // Is it a value within our criteria
1310 1310
                 ++$returnValue;
@@ -2314,7 +2314,7 @@  discard block
 block discarded – undo
2314 2314
             if (!is_numeric($arg)) {
2315 2315
                 $arg = \PhpOffice\PhpSpreadsheet\Calculation::wrapResult(strtoupper($arg));
2316 2316
             }
2317
-            $testCondition = '='.$arg.$condition;
2317
+            $testCondition = '=' . $arg . $condition;
2318 2318
             if (\PhpOffice\PhpSpreadsheet\Calculation::getInstance()->_calculateFormulaValue($testCondition)) {
2319 2319
                 if ((is_null($returnValue)) || ($arg > $returnValue)) {
2320 2320
                     $returnValue = $arg;
@@ -2476,7 +2476,7 @@  discard block
 block discarded – undo
2476 2476
             if (!is_numeric($arg)) {
2477 2477
                 $arg = \PhpOffice\PhpSpreadsheet\Calculation::wrapResult(strtoupper($arg));
2478 2478
             }
2479
-            $testCondition = '='.$arg.$condition;
2479
+            $testCondition = '=' . $arg . $condition;
2480 2480
             if (\PhpOffice\PhpSpreadsheet\Calculation::getInstance()->_calculateFormulaValue($testCondition)) {
2481 2481
                 if ((is_null($returnValue)) || ($arg < $returnValue)) {
2482 2482
                     $returnValue = $arg;
Please login to merge, or discard this patch.
src/PhpSpreadsheet/Calculation/DateTime.php 1 patch
Spacing   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -130,10 +130,10 @@  discard block
 block discarded – undo
130 130
 
131 131
         $adjustmentMonthsString = (string) $adjustmentMonths;
132 132
         if ($adjustmentMonths > 0) {
133
-            $adjustmentMonthsString = '+'.$adjustmentMonths;
133
+            $adjustmentMonthsString = '+' . $adjustmentMonths;
134 134
         }
135 135
         if ($adjustmentMonths != 0) {
136
-            $PHPDateObject->modify($adjustmentMonthsString.' months');
136
+            $PHPDateObject->modify($adjustmentMonthsString . ' months');
137 137
         }
138 138
         $nMonth = (int) $PHPDateObject->format('m');
139 139
         $nYear = (int) $PHPDateObject->format('Y');
@@ -141,7 +141,7 @@  discard block
 block discarded – undo
141 141
         $monthDiff = ($nMonth - $oMonth) + (($nYear - $oYear) * 12);
142 142
         if ($monthDiff != $adjustmentMonths) {
143 143
             $adjustDays = (int) $PHPDateObject->format('d');
144
-            $adjustDaysString = '-'.$adjustDays.' days';
144
+            $adjustDaysString = '-' . $adjustDays . ' days';
145 145
             $PHPDateObject->modify($adjustDaysString);
146 146
         }
147 147
 
@@ -449,9 +449,9 @@  discard block
 block discarded – undo
449 449
                     $dayAdjust = floor($hour / 24);
450 450
                     $hour = $hour % 24;
451 451
                 }
452
-                $phpDateObject = new \DateTime('1900-01-01 '.$hour.':'.$minute.':'.$second);
452
+                $phpDateObject = new \DateTime('1900-01-01 ' . $hour . ':' . $minute . ':' . $second);
453 453
                 if ($dayAdjust != 0) {
454
-                    $phpDateObject->modify($dayAdjust.' days');
454
+                    $phpDateObject->modify($dayAdjust . ' days');
455 455
                 }
456 456
 
457 457
                 return $phpDateObject;
@@ -546,9 +546,9 @@  discard block
 block discarded – undo
546 546
             if ($testVal1 < 31 && $testVal2 < 12 && $testVal3 < 12 && strlen($testVal3) == 2) {
547 547
                 $testVal3 += 2000;
548 548
             }
549
-            $PHPDateArray = date_parse($testVal1.'-'.$testVal2.'-'.$testVal3);
549
+            $PHPDateArray = date_parse($testVal1 . '-' . $testVal2 . '-' . $testVal3);
550 550
             if (($PHPDateArray === false) || ($PHPDateArray['error_count'] > 0)) {
551
-                $PHPDateArray = date_parse($testVal2.'-'.$testVal1.'-'.$testVal3);
551
+                $PHPDateArray = date_parse($testVal2 . '-' . $testVal1 . '-' . $testVal3);
552 552
                 if (($PHPDateArray === false) || ($PHPDateArray['error_count'] > 0)) {
553 553
                     return Functions::VALUE();
554 554
                 }
@@ -588,7 +588,7 @@  discard block
 block discarded – undo
588 588
                 case Functions::RETURNDATE_PHP_NUMERIC:
589 589
                     return (int) \PhpOffice\PhpSpreadsheet\Shared\Date::excelToTimestamp($excelDateValue);
590 590
                 case Functions::RETURNDATE_PHP_OBJECT:
591
-                    return new \DateTime($PHPDateArray['year'].'-'.$PHPDateArray['month'].'-'.$PHPDateArray['day'].' 00:00:00');
591
+                    return new \DateTime($PHPDateArray['year'] . '-' . $PHPDateArray['month'] . '-' . $PHPDateArray['day'] . ' 00:00:00');
592 592
             }
593 593
         }
594 594
 
@@ -650,7 +650,7 @@  discard block
 block discarded – undo
650 650
                 case Functions::RETURNDATE_PHP_NUMERIC:
651 651
                     return (int) $phpDateValue = \PhpOffice\PhpSpreadsheet\Shared\Date::excelToTimestamp($excelDateValue + 25569) - 3600;
652 652
                 case Functions::RETURNDATE_PHP_OBJECT:
653
-                    return new \DateTime('1900-01-01 '.$PHPDateArray['hour'].':'.$PHPDateArray['minute'].':'.$PHPDateArray['second']);
653
+                    return new \DateTime('1900-01-01 ' . $PHPDateArray['hour'] . ':' . $PHPDateArray['minute'] . ':' . $PHPDateArray['second']);
654 654
             }
655 655
         }
656 656
 
@@ -726,7 +726,7 @@  discard block
 block discarded – undo
726 726
             case 'MD':
727 727
                 if ($endDays < $startDays) {
728 728
                     $retVal = $endDays;
729
-                    $PHPEndDateObject->modify('-'.$endDays.' days');
729
+                    $PHPEndDateObject->modify('-' . $endDays . ' days');
730 730
                     $adjustDays = $PHPEndDateObject->format('j');
731 731
                     $retVal += ($adjustDays - $startDays);
732 732
                 } else {
@@ -1280,7 +1280,7 @@  discard block
 block discarded – undo
1280 1280
         // Execute function
1281 1281
         $PHPDateObject = \PhpOffice\PhpSpreadsheet\Shared\Date::excelToDateTimeObject($dateValue);
1282 1282
         $dayOfYear = $PHPDateObject->format('z');
1283
-        $PHPDateObject->modify('-'.$dayOfYear.' days');
1283
+        $PHPDateObject->modify('-' . $dayOfYear . ' days');
1284 1284
         $firstDayOfFirstWeek = $PHPDateObject->format('w');
1285 1285
         $daysInFirstWeek = (6 - $firstDayOfFirstWeek + $method) % 7;
1286 1286
         $interval = $dayOfYear - $daysInFirstWeek;
@@ -1564,7 +1564,7 @@  discard block
 block discarded – undo
1564 1564
         // Execute function
1565 1565
         $PHPDateObject = self::adjustDateByMonths($dateValue, $adjustmentMonths + 1);
1566 1566
         $adjustDays = (int) $PHPDateObject->format('d');
1567
-        $adjustDaysString = '-'.$adjustDays.' days';
1567
+        $adjustDaysString = '-' . $adjustDays . ' days';
1568 1568
         $PHPDateObject->modify($adjustDaysString);
1569 1569
 
1570 1570
         switch (Functions::getReturnDateType()) {
Please login to merge, or discard this patch.
src/PhpSpreadsheet/Calculation/MathTrig.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -975,7 +975,7 @@  discard block
 block discarded – undo
975 975
         $t = self::romanCut($aValue, 10);
976 976
         $aValue %= 10;
977 977
 
978
-        return $roman.$mill[$m].$cent[$c].$tens[$t].$ones[$aValue];
978
+        return $roman . $mill[$m] . $cent[$c] . $tens[$t] . $ones[$aValue];
979 979
     }
980 980
 
981 981
     /**
@@ -1234,7 +1234,7 @@  discard block
 block discarded – undo
1234 1234
                 $arg = \PhpOffice\PhpSpreadsheet\Calculation::wrapResult(strtoupper($arg));
1235 1235
             }
1236 1236
 
1237
-            $testCondition = '='.$arg.$condition;
1237
+            $testCondition = '=' . $arg . $condition;
1238 1238
             if (\PhpOffice\PhpSpreadsheet\Calculation::getInstance()->_calculateFormulaValue($testCondition)) {
1239 1239
                 // Is it a value within our criteria
1240 1240
                 $returnValue += $sumArgs[$key];
@@ -1282,7 +1282,7 @@  discard block
 block discarded – undo
1282 1282
                 if (!is_numeric($arg)) {
1283 1283
                     $arg = \PhpOffice\PhpSpreadsheet\Calculation::wrapResult(strtoupper($arg));
1284 1284
                 }
1285
-                $testCondition = '='.$arg.$condition;
1285
+                $testCondition = '=' . $arg . $condition;
1286 1286
                 if (\PhpOffice\PhpSpreadsheet\Calculation::getInstance()->_calculateFormulaValue($testCondition)) {
1287 1287
                     // Is it a value within our criteria
1288 1288
                     $returnValue += $sumArgs[$key];
Please login to merge, or discard this patch.
src/PhpSpreadsheet/Style/Fill.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -330,10 +330,10 @@
 block discarded – undo
330 330
         }
331 331
 
332 332
         return md5(
333
-            $this->getFillType().
334
-            $this->getRotation().
335
-            $this->getStartColor()->getHashCode().
336
-            $this->getEndColor()->getHashCode().
333
+            $this->getFillType() .
334
+            $this->getRotation() .
335
+            $this->getStartColor()->getHashCode() .
336
+            $this->getEndColor()->getHashCode() .
337 337
             __CLASS__
338 338
         );
339 339
     }
Please login to merge, or discard this patch.
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.