Completed
Push — develop ( e1f81f...539a89 )
by Adrien
16:11
created
src/PhpSpreadsheet/Chart.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -668,7 +668,7 @@
 block discarded – undo
668 668
             set_include_path(get_include_path() . PATH_SEPARATOR . $libraryPath);
669 669
         }
670 670
 
671
-        $rendererName = '\\PhpSpreadsheet\\Chart\\Renderer\\'.$libraryName;
671
+        $rendererName = '\\PhpSpreadsheet\\Chart\\Renderer\\' . $libraryName;
672 672
         $renderer = new $rendererName($this);
673 673
 
674 674
         if ($outputDestination == 'php://output') {
Please login to merge, or discard this patch.
src/PhpSpreadsheet/Shared/Excel5.php 1 patch
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -233,8 +233,8 @@  discard block
 block discarded – undo
233 233
         $y1 = $offsetY;
234 234
 
235 235
         // Initialise end cell to the same as the start cell
236
-        $col_end    = $col_start;  // Col containing lower right corner of object
237
-        $row_end    = $row_start;  // Row containing bottom right corner of object
236
+        $col_end    = $col_start; // Col containing lower right corner of object
237
+        $row_end    = $row_start; // Row containing bottom right corner of object
238 238
 
239 239
         // Zero the specified offset if greater than the cell dimensions
240 240
         if ($x1 >= self::sizeCol($sheet, \PhpSpreadsheet\Cell::stringFromColumnIndex($col_start))) {
@@ -244,8 +244,8 @@  discard block
 block discarded – undo
244 244
             $y1 = 0;
245 245
         }
246 246
 
247
-        $width      = $width  + $x1 -1;
248
-        $height     = $height + $y1 -1;
247
+        $width      = $width + $x1 - 1;
248
+        $height     = $height + $y1 - 1;
249 249
 
250 250
         // Subtract the underlying cell widths to find the end cell of the image
251 251
         while ($width >= self::sizeCol($sheet, \PhpSpreadsheet\Cell::stringFromColumnIndex($col_end))) {
@@ -264,21 +264,21 @@  discard block
 block discarded – undo
264 264
         if (self::sizeCol($sheet, \PhpSpreadsheet\Cell::stringFromColumnIndex($col_start)) == 0) {
265 265
             return;
266 266
         }
267
-        if (self::sizeCol($sheet, \PhpSpreadsheet\Cell::stringFromColumnIndex($col_end))   == 0) {
267
+        if (self::sizeCol($sheet, \PhpSpreadsheet\Cell::stringFromColumnIndex($col_end)) == 0) {
268 268
             return;
269 269
         }
270 270
         if (self::sizeRow($sheet, $row_start + 1) == 0) {
271 271
             return;
272 272
         }
273
-        if (self::sizeRow($sheet, $row_end + 1)   == 0) {
273
+        if (self::sizeRow($sheet, $row_end + 1) == 0) {
274 274
             return;
275 275
         }
276 276
 
277 277
         // Convert the pixel values to the percentage value expected by Excel
278
-        $x1 = $x1     / self::sizeCol($sheet, \PhpSpreadsheet\Cell::stringFromColumnIndex($col_start))   * 1024;
279
-        $y1 = $y1     / self::sizeRow($sheet, $row_start + 1)   *  256;
280
-        $x2 = ($width + 1)  / self::sizeCol($sheet, \PhpSpreadsheet\Cell::stringFromColumnIndex($col_end))     * 1024; // Distance to right side of object
281
-        $y2 = ($height + 1) / self::sizeRow($sheet, $row_end + 1)     *  256; // Distance to bottom of object
278
+        $x1 = $x1 / self::sizeCol($sheet, \PhpSpreadsheet\Cell::stringFromColumnIndex($col_start)) * 1024;
279
+        $y1 = $y1 / self::sizeRow($sheet, $row_start + 1) * 256;
280
+        $x2 = ($width + 1) / self::sizeCol($sheet, \PhpSpreadsheet\Cell::stringFromColumnIndex($col_end)) * 1024; // Distance to right side of object
281
+        $y2 = ($height + 1) / self::sizeRow($sheet, $row_end + 1) * 256; // Distance to bottom of object
282 282
 
283 283
         $startCoordinates = \PhpSpreadsheet\Cell::stringFromColumnIndex($col_start) . ($row_start + 1);
284 284
         $endCoordinates = \PhpSpreadsheet\Cell::stringFromColumnIndex($col_end) . ($row_end + 1);
Please login to merge, or discard this patch.
src/PhpSpreadsheet/Shared/Font.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -45,8 +45,8 @@  discard block
 block discarded – undo
45 45
     const CHARSET_ANSI_JAPANESE_SHIFTJIS    = 0x80;
46 46
     const CHARSET_ANSI_KOREAN_HANGUL        = 0x81;
47 47
     const CHARSET_ANSI_KOREAN_JOHAB         = 0x82;
48
-    const CHARSET_ANSI_CHINESE_SIMIPLIFIED  = 0x86;        //    gb2312
49
-    const CHARSET_ANSI_CHINESE_TRADITIONAL  = 0x88;        //    big5
48
+    const CHARSET_ANSI_CHINESE_SIMIPLIFIED  = 0x86; //    gb2312
49
+    const CHARSET_ANSI_CHINESE_TRADITIONAL  = 0x88; //    big5
50 50
     const CHARSET_ANSI_GREEK                = 0xA1;
51 51
     const CHARSET_ANSI_TURKISH              = 0xA2;
52 52
     const CHARSET_ANSI_VIETNAMESE           = 0xA3;
@@ -511,7 +511,7 @@  discard block
 block discarded – undo
511 511
                 );
512 512
                 break;
513 513
             default:
514
-                throw new \PhpSpreadsheet\Exception('Unknown font name "'. $name .'". Cannot map to TrueType font file');
514
+                throw new \PhpSpreadsheet\Exception('Unknown font name "' . $name . '". Cannot map to TrueType font file');
515 515
                 break;
516 516
         }
517 517
 
Please login to merge, or discard this patch.
src/PhpSpreadsheet/Shared/CodePage.php 1 patch
Spacing   +52 added lines, -52 removed lines patch added patch discarded remove patch
@@ -40,117 +40,117 @@
 block discarded – undo
40 40
     {
41 41
         switch ($codePage) {
42 42
             case 367:
43
-                return 'ASCII';    //    ASCII
43
+                return 'ASCII'; //    ASCII
44 44
             case 437:
45
-                return 'CP437';    //    OEM US
45
+                return 'CP437'; //    OEM US
46 46
             case 720:
47
-                throw new \PhpSpreadsheet\Exception('Code page 720 not supported.');    //    OEM Arabic
47
+                throw new \PhpSpreadsheet\Exception('Code page 720 not supported.'); //    OEM Arabic
48 48
             case 737:
49
-                return 'CP737';    //    OEM Greek
49
+                return 'CP737'; //    OEM Greek
50 50
             case 775:
51
-                return 'CP775';    //    OEM Baltic
51
+                return 'CP775'; //    OEM Baltic
52 52
             case 850:
53
-                return 'CP850';    //    OEM Latin I
53
+                return 'CP850'; //    OEM Latin I
54 54
             case 852:
55
-                return 'CP852';    //    OEM Latin II (Central European)
55
+                return 'CP852'; //    OEM Latin II (Central European)
56 56
             case 855:
57
-                return 'CP855';    //    OEM Cyrillic
57
+                return 'CP855'; //    OEM Cyrillic
58 58
             case 857:
59
-                return 'CP857';    //    OEM Turkish
59
+                return 'CP857'; //    OEM Turkish
60 60
             case 858:
61
-                return 'CP858';    //    OEM Multilingual Latin I with Euro
61
+                return 'CP858'; //    OEM Multilingual Latin I with Euro
62 62
             case 860:
63
-                return 'CP860';    //    OEM Portugese
63
+                return 'CP860'; //    OEM Portugese
64 64
             case 861:
65
-                return 'CP861';    //    OEM Icelandic
65
+                return 'CP861'; //    OEM Icelandic
66 66
             case 862:
67
-                return 'CP862';    //    OEM Hebrew
67
+                return 'CP862'; //    OEM Hebrew
68 68
             case 863:
69
-                return 'CP863';    //    OEM Canadian (French)
69
+                return 'CP863'; //    OEM Canadian (French)
70 70
             case 864:
71
-                return 'CP864';    //    OEM Arabic
71
+                return 'CP864'; //    OEM Arabic
72 72
             case 865:
73
-                return 'CP865';    //    OEM Nordic
73
+                return 'CP865'; //    OEM Nordic
74 74
             case 866:
75
-                return 'CP866';    //    OEM Cyrillic (Russian)
75
+                return 'CP866'; //    OEM Cyrillic (Russian)
76 76
             case 869:
77
-                return 'CP869';    //    OEM Greek (Modern)
77
+                return 'CP869'; //    OEM Greek (Modern)
78 78
             case 874:
79
-                return 'CP874';    //    ANSI Thai
79
+                return 'CP874'; //    ANSI Thai
80 80
             case 932:
81
-                return 'CP932';    //    ANSI Japanese Shift-JIS
81
+                return 'CP932'; //    ANSI Japanese Shift-JIS
82 82
             case 936:
83
-                return 'CP936';    //    ANSI Chinese Simplified GBK
83
+                return 'CP936'; //    ANSI Chinese Simplified GBK
84 84
             case 949:
85
-                return 'CP949';    //    ANSI Korean (Wansung)
85
+                return 'CP949'; //    ANSI Korean (Wansung)
86 86
             case 950:
87
-                return 'CP950';    //    ANSI Chinese Traditional BIG5
87
+                return 'CP950'; //    ANSI Chinese Traditional BIG5
88 88
             case 1200:
89 89
                 return 'UTF-16LE'; //    UTF-16 (BIFF8)
90 90
             case 1250:
91
-                return 'CP1250';   //    ANSI Latin II (Central European)
91
+                return 'CP1250'; //    ANSI Latin II (Central European)
92 92
             case 1251:
93
-                return 'CP1251';   //    ANSI Cyrillic
93
+                return 'CP1251'; //    ANSI Cyrillic
94 94
             case 0:
95 95
                 //    CodePage is not always correctly set when the xls file was saved by Apple's Numbers program
96 96
             case 1252:
97
-                return 'CP1252';   //    ANSI Latin I (BIFF4-BIFF7)
97
+                return 'CP1252'; //    ANSI Latin I (BIFF4-BIFF7)
98 98
             case 1253:
99
-                return 'CP1253';   //    ANSI Greek
99
+                return 'CP1253'; //    ANSI Greek
100 100
             case 1254:
101
-                return 'CP1254';   //    ANSI Turkish
101
+                return 'CP1254'; //    ANSI Turkish
102 102
             case 1255:
103
-                return 'CP1255';   //    ANSI Hebrew
103
+                return 'CP1255'; //    ANSI Hebrew
104 104
             case 1256:
105
-                return 'CP1256';   //    ANSI Arabic
105
+                return 'CP1256'; //    ANSI Arabic
106 106
             case 1257:
107
-                return 'CP1257';   //    ANSI Baltic
107
+                return 'CP1257'; //    ANSI Baltic
108 108
             case 1258:
109
-                return 'CP1258';   //    ANSI Vietnamese
109
+                return 'CP1258'; //    ANSI Vietnamese
110 110
             case 1361:
111
-                return 'CP1361';   //    ANSI Korean (Johab)
111
+                return 'CP1361'; //    ANSI Korean (Johab)
112 112
             case 10000:
113
-                return 'MAC';      //    Apple Roman
113
+                return 'MAC'; //    Apple Roman
114 114
             case 10001:
115
-                return 'CP932';    //    Macintosh Japanese
115
+                return 'CP932'; //    Macintosh Japanese
116 116
             case 10002:
117
-                return 'CP950';    //    Macintosh Chinese Traditional
117
+                return 'CP950'; //    Macintosh Chinese Traditional
118 118
             case 10003:
119
-                return 'CP1361';   //    Macintosh Korean
119
+                return 'CP1361'; //    Macintosh Korean
120 120
             case 10004:
121 121
                 return 'MACARABIC'; //    Apple Arabic
122 122
             case 10005:
123 123
                 return 'MACHEBREW'; //    Apple Hebrew
124 124
             case 10006:
125
-                return 'MACGREEK';  //    Macintosh Greek
125
+                return 'MACGREEK'; //    Macintosh Greek
126 126
             case 10007:
127
-                return 'MACCYRILLIC';  //    Macintosh Cyrillic
127
+                return 'MACCYRILLIC'; //    Macintosh Cyrillic
128 128
             case 10008:
129
-                return 'CP936';  //    Macintosh - Simplified Chinese (GB 2312)
129
+                return 'CP936'; //    Macintosh - Simplified Chinese (GB 2312)
130 130
             case 10010:
131
-                return 'MACROMANIA';    //    Macintosh Romania
131
+                return 'MACROMANIA'; //    Macintosh Romania
132 132
             case 10017:
133
-                return 'MACUKRAINE';    //    Macintosh Ukraine
133
+                return 'MACUKRAINE'; //    Macintosh Ukraine
134 134
             case 10021:
135
-                return 'MACTHAI';    //    Macintosh Thai
135
+                return 'MACTHAI'; //    Macintosh Thai
136 136
             case 10029:
137
-                return 'MACCENTRALEUROPE';  //    Macintosh Central Europe
137
+                return 'MACCENTRALEUROPE'; //    Macintosh Central Europe
138 138
             case 10079:
139
-                return 'MACICELAND';  //    Macintosh Icelandic
139
+                return 'MACICELAND'; //    Macintosh Icelandic
140 140
             case 10081:
141
-                return 'MACTURKISH';  //    Macintosh Turkish
141
+                return 'MACTURKISH'; //    Macintosh Turkish
142 142
             case 10082:
143
-                return 'MACCROATIAN';    //    Macintosh Croatian
143
+                return 'MACCROATIAN'; //    Macintosh Croatian
144 144
             case 21010:
145
-                return 'UTF-16LE';  //    UTF-16 (BIFF8) This isn't correct, but some Excel writer libraries erroneously use Codepage 21010 for UTF-16LE
145
+                return 'UTF-16LE'; //    UTF-16 (BIFF8) This isn't correct, but some Excel writer libraries erroneously use Codepage 21010 for UTF-16LE
146 146
             case 32768:
147
-                return 'MAC';      //    Apple Roman
147
+                return 'MAC'; //    Apple Roman
148 148
             case 32769:
149
-                throw new \PhpSpreadsheet\Exception('Code page 32769 not supported.');  //    ANSI Latin I (BIFF2-BIFF3)
149
+                throw new \PhpSpreadsheet\Exception('Code page 32769 not supported.'); //    ANSI Latin I (BIFF2-BIFF3)
150 150
             case 65000:
151
-                return 'UTF-7';    //    Unicode (UTF-7)
151
+                return 'UTF-7'; //    Unicode (UTF-7)
152 152
             case 65001:
153
-                return 'UTF-8';    //    Unicode (UTF-8)
153
+                return 'UTF-8'; //    Unicode (UTF-8)
154 154
         }
155 155
         throw new \PhpSpreadsheet\Exception('Unknown codepage: ' . $codePage);
156 156
     }
Please login to merge, or discard this patch.
src/PhpSpreadsheet/Shared/Trend/Trend.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -86,7 +86,7 @@  discard block
 block discarded – undo
86 86
             trigger_error("Trend(): Number of elements in coordinate arrays do not match.", E_USER_ERROR);
87 87
         }
88 88
 
89
-        $key = md5($trendType.$const.serialize($yValues).serialize($xValues));
89
+        $key = md5($trendType . $const . serialize($yValues) . serialize($xValues));
90 90
         //    Determine which Trend method has been requested
91 91
         switch ($trendType) {
92 92
             //    Instantiate and return the class for the requested Trend method
@@ -95,7 +95,7 @@  discard block
 block discarded – undo
95 95
             case self::TREND_EXPONENTIAL:
96 96
             case self::TREND_POWER:
97 97
                 if (!isset(self::$trendCache[$key])) {
98
-                    $className = '\PhpSpreadsheet\Shared\Trend\\'.$trendType.'BestFit';
98
+                    $className = '\PhpSpreadsheet\Shared\Trend\\' . $trendType . 'BestFit';
99 99
                     self::$trendCache[$key] = new $className($yValues, $xValues, $const);
100 100
                 }
101 101
                 return self::$trendCache[$key];
@@ -114,7 +114,7 @@  discard block
 block discarded – undo
114 114
                 //    If the request is to determine the best fit regression, then we test each Trend line in turn
115 115
                 //    Start by generating an instance of each available Trend method
116 116
                 foreach (self::$trendTypes as $trendMethod) {
117
-                    $className = '\PhpSpreadsheet\Shared\Trend\\'.$trendType.'BestFit';
117
+                    $className = '\PhpSpreadsheet\Shared\Trend\\' . $trendType . 'BestFit';
118 118
                     $bestFit[$trendMethod] = new $className($yValues, $xValues, $const);
119 119
                     $bestFitValue[$trendMethod] = $bestFit[$trendMethod]->getGoodnessOfFit();
120 120
                 }
Please login to merge, or discard this patch.
src/PhpSpreadsheet/Cell/AdvancedValueBinder.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -55,7 +55,7 @@  discard block
 block discarded – undo
55 55
             }
56 56
 
57 57
             // Check for number in scientific format
58
-            if (preg_match('/^'.\PhpSpreadsheet\Calculation::CALCULATION_REGEXP_NUMBER.'$/', $value)) {
58
+            if (preg_match('/^' . \PhpSpreadsheet\Calculation::CALCULATION_REGEXP_NUMBER . '$/', $value)) {
59 59
                 $cell->setValueExplicit((float) $value, DataType::TYPE_NUMERIC);
60 60
                 return true;
61 61
             }
@@ -100,7 +100,7 @@  discard block
 block discarded – undo
100 100
             $currencyCode = \PhpSpreadsheet\Shared\StringHelper::getCurrencyCode();
101 101
             $decimalSeparator = \PhpSpreadsheet\Shared\StringHelper::getDecimalSeparator();
102 102
             $thousandsSeparator = \PhpSpreadsheet\Shared\StringHelper::getThousandsSeparator();
103
-            if (preg_match('/^'.preg_quote($currencyCode).' *(\d{1,3}('.preg_quote($thousandsSeparator).'\d{3})*|(\d+))('.preg_quote($decimalSeparator).'\d{2})?$/', $value)) {
103
+            if (preg_match('/^' . preg_quote($currencyCode) . ' *(\d{1,3}(' . preg_quote($thousandsSeparator) . '\d{3})*|(\d+))(' . preg_quote($decimalSeparator) . '\d{2})?$/', $value)) {
104 104
                 // Convert value to number
105 105
                 $value = (float) trim(str_replace(array($currencyCode, $thousandsSeparator, $decimalSeparator), array('', '', '.'), $value));
106 106
                 $cell->setValueExplicit($value, DataType::TYPE_NUMERIC);
@@ -112,7 +112,7 @@  discard block
 block discarded – undo
112 112
                 return true;
113 113
             } elseif (preg_match('/^\$ *(\d{1,3}(\,\d{3})*|(\d+))(\.\d{2})?$/', $value)) {
114 114
                 // Convert value to number
115
-                $value = (float) trim(str_replace(array('$',','), '', $value));
115
+                $value = (float) trim(str_replace(array('$', ','), '', $value));
116 116
                 $cell->setValueExplicit($value, DataType::TYPE_NUMERIC);
117 117
                 // Set style
118 118
                 $cell->getWorksheet()->getStyle($cell->getCoordinate())
Please login to merge, or discard this patch.
src/PhpSpreadsheet/CachedObjectStorageFactory.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -171,7 +171,7 @@
 block discarded – undo
171 171
             return false;
172 172
         }
173 173
 
174
-        $cacheStorageClass = '\\PhpSpreadsheet\\CachedObjectStorage\\'.$method;
174
+        $cacheStorageClass = '\\PhpSpreadsheet\\CachedObjectStorage\\' . $method;
175 175
         if (!call_user_func([$cacheStorageClass, 'cacheMethodIsAvailable'])) {
176 176
             return false;
177 177
         }
Please login to merge, or discard this patch.
src/PhpSpreadsheet/Worksheet/AutoFilter.php 1 patch
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -407,7 +407,7 @@  discard block
 block discarded – undo
407 407
                 }
408 408
             } else {
409 409
                 //    String values are always tested for equality, factoring in for wildcards (hence a regexp test)
410
-                $retVal    = preg_match('/^'.$rule['value'].'$/i', $cellValue);
410
+                $retVal = preg_match('/^' . $rule['value'] . '$/i', $cellValue);
411 411
             }
412 412
             //    If there are multiple conditions, then we need to test both using the appropriate join operator
413 413
             switch ($join) {
@@ -458,7 +458,7 @@  discard block
 block discarded – undo
458 458
      *    @var    array
459 459
      */
460 460
     private static $fromReplace = array('\*', '\?', '~~', '~.*', '~.?');
461
-    private static $toReplace   = array('.*', '.',  '~',  '\*',  '\?');
461
+    private static $toReplace   = array('.*', '.', '~', '\*', '\?');
462 462
 
463 463
 
464 464
     /**
@@ -527,9 +527,9 @@  discard block
 block discarded – undo
527 527
             case AutoFilter\Column\Rule::AUTOFILTER_RULETYPE_DYNAMIC_NEXTQUARTER:
528 528
                 $thisMonth = date('m', $baseDate);
529 529
                 $thisQuarter = floor(--$thisMonth / 3);
530
-                $maxVal = (int) \PhpSpreadsheet\Shared\Date::PHPtoExcel(gmmktime(0, 0, 0, date('t', $baseDate), (1+$thisQuarter)*3, date('Y', $baseDate)));
530
+                $maxVal = (int) \PhpSpreadsheet\Shared\Date::PHPtoExcel(gmmktime(0, 0, 0, date('t', $baseDate), (1 + $thisQuarter) * 3, date('Y', $baseDate)));
531 531
                 ++$maxVal;
532
-                $val = (int) \PhpSpreadsheet\Shared\Date::PHPToExcel(gmmktime(0, 0, 0, 1, 1+$thisQuarter*3, date('Y', $baseDate)));
532
+                $val = (int) \PhpSpreadsheet\Shared\Date::PHPToExcel(gmmktime(0, 0, 0, 1, 1 + $thisQuarter * 3, date('Y', $baseDate)));
533 533
                 break;
534 534
             case AutoFilter\Column\Rule::AUTOFILTER_RULETYPE_DYNAMIC_THISMONTH:
535 535
             case AutoFilter\Column\Rule::AUTOFILTER_RULETYPE_DYNAMIC_LASTMONTH:
@@ -572,7 +572,7 @@  discard block
 block discarded – undo
572 572
 
573 573
     private function calculateTopTenValue($columnID, $startRow, $endRow, $ruleType, $ruleValue)
574 574
     {
575
-        $range = $columnID.$startRow.':'.$columnID.$endRow;
575
+        $range = $columnID . $startRow . ':' . $columnID . $endRow;
576 576
         $dataValues = \PhpSpreadsheet\Calculation\Functions::flattenArray($this->workSheet->rangeToArray($range, null, true, false));
577 577
 
578 578
         $dataValues = array_filter($dataValues);
@@ -703,7 +703,7 @@  discard block
 block discarded – undo
703 703
                             ($dynamicRuleType == AutoFilter\Column\Rule::AUTOFILTER_RULETYPE_DYNAMIC_BELOWAVERAGE)) {
704 704
                             //    Number (Average) based
705 705
                             //    Calculate the average
706
-                            $averageFormula = '=AVERAGE('.$columnID.($rangeStart[1]+1).':'.$columnID.$rangeEnd[1].')';
706
+                            $averageFormula = '=AVERAGE(' . $columnID . ($rangeStart[1] + 1) . ':' . $columnID . $rangeEnd[1] . ')';
707 707
                             $average = \PhpSpreadsheet\Calculation::getInstance()->calculateFormula($averageFormula, null, $this->workSheet->getCell('A1'));
708 708
                             //    Set above/below rule based on greaterThan or LessTan
709 709
                             $operator = ($dynamicRuleType === AutoFilter\Column\Rule::AUTOFILTER_RULETYPE_DYNAMIC_ABOVEAVERAGE)
@@ -725,8 +725,8 @@  discard block
 block discarded – undo
725 725
                                     $ruleValues = array($period);
726 726
                                 } else {
727 727
                                     --$period;
728
-                                    $periodEnd = (1+$period)*3;
729
-                                    $periodStart = 1+$period*3;
728
+                                    $periodEnd = (1 + $period) * 3;
729
+                                    $periodStart = 1 + $period * 3;
730 730
                                     $ruleValues = range($periodStart, $periodEnd);
731 731
                                 }
732 732
                                 $columnFilterTests[$columnID] = array(
@@ -761,7 +761,7 @@  discard block
 block discarded – undo
761 761
                         $ruleValue = 500;
762 762
                     }
763 763
 
764
-                    $maxVal = $this->calculateTopTenValue($columnID, $rangeStart[1]+1, $rangeEnd[1], $toptenRuleType, $ruleValue);
764
+                    $maxVal = $this->calculateTopTenValue($columnID, $rangeStart[1] + 1, $rangeEnd[1], $toptenRuleType, $ruleValue);
765 765
 
766 766
                     $operator = ($toptenRuleType == AutoFilter\Column\Rule::AUTOFILTER_COLUMN_RULE_TOPTEN_TOP)
767 767
                         ? AutoFilter\Column\Rule::AUTOFILTER_COLUMN_RULE_GREATERTHANOREQUAL
@@ -780,12 +780,12 @@  discard block
 block discarded – undo
780 780
 //        var_dump($columnFilterTests);
781 781
 //
782 782
         //    Execute the column tests for each row in the autoFilter range to determine show/hide,
783
-        for ($row = $rangeStart[1]+1; $row <= $rangeEnd[1]; ++$row) {
783
+        for ($row = $rangeStart[1] + 1; $row <= $rangeEnd[1]; ++$row) {
784 784
 //            echo 'Testing Row = ', $row,PHP_EOL;
785 785
             $result = true;
786 786
             foreach ($columnFilterTests as $columnID => $columnFilterTest) {
787 787
 //                echo 'Testing cell ', $columnID.$row,PHP_EOL;
788
-                $cellValue = $this->workSheet->getCell($columnID.$row)->getCalculatedValue();
788
+                $cellValue = $this->workSheet->getCell($columnID . $row)->getCalculatedValue();
789 789
 //                echo 'Value is ', $cellValue,PHP_EOL;
790 790
                 //    Execute the filter test
791 791
                 $result = $result &&
Please login to merge, or discard this patch.
src/PhpSpreadsheet/Calculation.php 1 patch
Spacing   +131 added lines, -131 removed lines patch added patch discarded remove patch
@@ -50,15 +50,15 @@  discard block
 block discarded – undo
50 50
     //    String operand
51 51
     const CALCULATION_REGEXP_STRING        = '"(?:[^"]|"")*"';
52 52
     //    Opening bracket
53
-    const CALCULATION_REGEXP_OPENBRACE    = '\(';
53
+    const CALCULATION_REGEXP_OPENBRACE = '\(';
54 54
     //    Function (allow for the old @ symbol that could be used to prefix a function, but we'll ignore it)
55
-    const CALCULATION_REGEXP_FUNCTION    = '@?([A-Z][A-Z0-9\.]*)[\s]*\(';
55
+    const CALCULATION_REGEXP_FUNCTION = '@?([A-Z][A-Z0-9\.]*)[\s]*\(';
56 56
     //    Cell reference (cell or range of cells, with or without a sheet reference)
57
-    const CALCULATION_REGEXP_CELLREF    = CALCULATION_REGEXP_CELLREF;
57
+    const CALCULATION_REGEXP_CELLREF = CALCULATION_REGEXP_CELLREF;
58 58
     //    Named Range of cells
59
-    const CALCULATION_REGEXP_NAMEDRANGE    = CALCULATION_REGEXP_NAMEDRANGE;
59
+    const CALCULATION_REGEXP_NAMEDRANGE = CALCULATION_REGEXP_NAMEDRANGE;
60 60
     //    Error
61
-    const CALCULATION_REGEXP_ERROR        = '\#[A-Z][A-Z0_\/]*[!\?]?';
61
+    const CALCULATION_REGEXP_ERROR = '\#[A-Z][A-Z0_\/]*[!\?]?';
62 62
 
63 63
 
64 64
     /** constants */
@@ -100,7 +100,7 @@  discard block
 block discarded – undo
100 100
      * @access    private
101 101
      * @var array
102 102
      */
103
-    private $calculationCache = array ();
103
+    private $calculationCache = array();
104 104
 
105 105
 
106 106
     /**
@@ -120,10 +120,10 @@  discard block
 block discarded – undo
120 120
      * @var array
121 121
      */
122 122
     private static $operators = array(
123
-        '+' => true,    '-' => true,    '*' => true,    '/' => true,
124
-        '^' => true,    '&' => true,    '%' => false,    '~' => false,
125
-        '>' => true,    '<' => true,    '=' => true,    '>=' => true,
126
-        '<=' => true,    '<>' => true,    '|' => true,    ':' => true
123
+        '+' => true, '-' => true, '*' => true, '/' => true,
124
+        '^' => true, '&' => true, '%' => false, '~' => false,
125
+        '>' => true, '<' => true, '=' => true, '>=' => true,
126
+        '<=' => true, '<>' => true, '|' => true, ':' => true
127 127
     );
128 128
 
129 129
     /**
@@ -133,10 +133,10 @@  discard block
 block discarded – undo
133 133
      * @var array
134 134
      */
135 135
     private static $binaryOperators = array(
136
-        '+' => true,    '-' => true,    '*' => true,    '/' => true,
137
-        '^' => true,    '&' => true,    '>' => true,    '<' => true,
138
-        '=' => true,    '>=' => true,    '<=' => true,    '<>' => true,
139
-        '|' => true,    ':' => true
136
+        '+' => true, '-' => true, '*' => true, '/' => true,
137
+        '^' => true, '&' => true, '>' => true, '<' => true,
138
+        '=' => true, '>=' => true, '<=' => true, '<>' => true,
139
+        '|' => true, ':' => true
140 140
     );
141 141
 
142 142
     /**
@@ -205,7 +205,7 @@  discard block
 block discarded – undo
205 205
      * @var float
206 206
      *
207 207
      */
208
-    private $delta    = 0.1e-12;
208
+    private $delta = 0.1e-12;
209 209
 
210 210
 
211 211
     /**
@@ -214,7 +214,7 @@  discard block
 block discarded – undo
214 214
      * @var string
215 215
      *
216 216
      */
217
-    private static $localeLanguage = 'en_us';                    //    US English    (default locale)
217
+    private static $localeLanguage = 'en_us'; //    US English    (default locale)
218 218
 
219 219
     /**
220 220
      * List of available locale settings
@@ -2072,9 +2072,9 @@  discard block
 block discarded – undo
2072 2072
 
2073 2073
     private static function loadLocales()
2074 2074
     {
2075
-        $localeFileDirectory = PHPSPREADSHEET_ROOT.'PhpSpreadsheet/locale/';
2076
-        foreach (glob($localeFileDirectory.'/*', GLOB_ONLYDIR) as $filename) {
2077
-            $filename = substr($filename, strlen($localeFileDirectory)+1);
2075
+        $localeFileDirectory = PHPSPREADSHEET_ROOT . 'PhpSpreadsheet/locale/';
2076
+        foreach (glob($localeFileDirectory . '/*', GLOB_ONLYDIR) as $filename) {
2077
+            $filename = substr($filename, strlen($localeFileDirectory) + 1);
2078 2078
             if ($filename != 'en') {
2079 2079
                 self::$validLocaleLanguages[] = $filename;
2080 2080
             }
@@ -2319,10 +2319,10 @@  discard block
 block discarded – undo
2319 2319
             //    Default is English, if user isn't requesting english, then read the necessary data from the locale files
2320 2320
             if ($locale != 'en_us') {
2321 2321
                 //    Search for a file with a list of function names for locale
2322
-                $functionNamesFile = PHPSPREADSHEET_ROOT . 'PhpSpreadsheet'.DIRECTORY_SEPARATOR.'locale'.DIRECTORY_SEPARATOR.str_replace('_', DIRECTORY_SEPARATOR, $locale).DIRECTORY_SEPARATOR.'functions';
2322
+                $functionNamesFile = PHPSPREADSHEET_ROOT . 'PhpSpreadsheet' . DIRECTORY_SEPARATOR . 'locale' . DIRECTORY_SEPARATOR . str_replace('_', DIRECTORY_SEPARATOR, $locale) . DIRECTORY_SEPARATOR . 'functions';
2323 2323
                 if (!file_exists($functionNamesFile)) {
2324 2324
                     //    If there isn't a locale specific function file, look for a language specific function file
2325
-                    $functionNamesFile = PHPSPREADSHEET_ROOT . 'PhpSpreadsheet'.DIRECTORY_SEPARATOR.'locale'.DIRECTORY_SEPARATOR.$language.DIRECTORY_SEPARATOR.'functions';
2325
+                    $functionNamesFile = PHPSPREADSHEET_ROOT . 'PhpSpreadsheet' . DIRECTORY_SEPARATOR . 'locale' . DIRECTORY_SEPARATOR . $language . DIRECTORY_SEPARATOR . 'functions';
2326 2326
                     if (!file_exists($functionNamesFile)) {
2327 2327
                         return false;
2328 2328
                     }
@@ -2330,7 +2330,7 @@  discard block
 block discarded – undo
2330 2330
                 //    Retrieve the list of locale or language specific function names
2331 2331
                 $localeFunctions = file($functionNamesFile, FILE_IGNORE_NEW_LINES | FILE_SKIP_EMPTY_LINES);
2332 2332
                 foreach ($localeFunctions as $localeFunction) {
2333
-                    list($localeFunction) = explode('##', $localeFunction);    //    Strip out comments
2333
+                    list($localeFunction) = explode('##', $localeFunction); //    Strip out comments
2334 2334
                     if (strpos($localeFunction, '=') !== false) {
2335 2335
                         list($fName, $lfName) = explode('=', $localeFunction);
2336 2336
                         $fName = trim($fName);
@@ -2348,14 +2348,14 @@  discard block
 block discarded – undo
2348 2348
                     self::$localeBoolean['FALSE'] = self::$localeFunctions['FALSE'];
2349 2349
                 }
2350 2350
 
2351
-                $configFile = PHPSPREADSHEET_ROOT . 'PhpSpreadsheet'.DIRECTORY_SEPARATOR.'locale'.DIRECTORY_SEPARATOR.str_replace('_', DIRECTORY_SEPARATOR, $locale).DIRECTORY_SEPARATOR.'config';
2351
+                $configFile = PHPSPREADSHEET_ROOT . 'PhpSpreadsheet' . DIRECTORY_SEPARATOR . 'locale' . DIRECTORY_SEPARATOR . str_replace('_', DIRECTORY_SEPARATOR, $locale) . DIRECTORY_SEPARATOR . 'config';
2352 2352
                 if (!file_exists($configFile)) {
2353
-                    $configFile = PHPSPREADSHEET_ROOT . 'PhpSpreadsheet'.DIRECTORY_SEPARATOR.'locale'.DIRECTORY_SEPARATOR.$language.DIRECTORY_SEPARATOR.'config';
2353
+                    $configFile = PHPSPREADSHEET_ROOT . 'PhpSpreadsheet' . DIRECTORY_SEPARATOR . 'locale' . DIRECTORY_SEPARATOR . $language . DIRECTORY_SEPARATOR . 'config';
2354 2354
                 }
2355 2355
                 if (file_exists($configFile)) {
2356 2356
                     $localeSettings = file($configFile, FILE_IGNORE_NEW_LINES | FILE_SKIP_EMPTY_LINES);
2357 2357
                     foreach ($localeSettings as $localeSetting) {
2358
-                        list($localeSetting) = explode('##', $localeSetting);    //    Strip out comments
2358
+                        list($localeSetting) = explode('##', $localeSetting); //    Strip out comments
2359 2359
                         if (strpos($localeSetting, '=') !== false) {
2360 2360
                             list($settingName, $settingValue) = explode('=', $localeSetting);
2361 2361
                             $settingName = strtoupper(trim($settingName));
@@ -2393,7 +2393,7 @@  discard block
 block discarded – undo
2393 2393
                     break;
2394 2394
                 case $fromSeparator:
2395 2395
                     if (!$inBraces) {
2396
-                        $formula = mb_substr($formula, 0, $i).$toSeparator.mb_substr($formula, $i+1);
2396
+                        $formula = mb_substr($formula, 0, $i) . $toSeparator . mb_substr($formula, $i + 1);
2397 2397
                     }
2398 2398
             }
2399 2399
         }
@@ -2439,20 +2439,20 @@  discard block
 block discarded – undo
2439 2439
         if (self::$functionReplaceFromExcel === null) {
2440 2440
             self::$functionReplaceFromExcel = array();
2441 2441
             foreach (array_keys(self::$localeFunctions) as $excelFunctionName) {
2442
-                self::$functionReplaceFromExcel[] = '/(@?[^\w\.])'.preg_quote($excelFunctionName).'([\s]*\()/Ui';
2442
+                self::$functionReplaceFromExcel[] = '/(@?[^\w\.])' . preg_quote($excelFunctionName) . '([\s]*\()/Ui';
2443 2443
             }
2444 2444
             foreach (array_keys(self::$localeBoolean) as $excelBoolean) {
2445
-                self::$functionReplaceFromExcel[] = '/(@?[^\w\.])'.preg_quote($excelBoolean).'([^\w\.])/Ui';
2445
+                self::$functionReplaceFromExcel[] = '/(@?[^\w\.])' . preg_quote($excelBoolean) . '([^\w\.])/Ui';
2446 2446
             }
2447 2447
         }
2448 2448
 
2449 2449
         if (self::$functionReplaceToLocale === null) {
2450 2450
             self::$functionReplaceToLocale = array();
2451 2451
             foreach (array_values(self::$localeFunctions) as $localeFunctionName) {
2452
-                self::$functionReplaceToLocale[] = '$1'.trim($localeFunctionName).'$2';
2452
+                self::$functionReplaceToLocale[] = '$1' . trim($localeFunctionName) . '$2';
2453 2453
             }
2454 2454
             foreach (array_values(self::$localeBoolean) as $localeBoolean) {
2455
-                self::$functionReplaceToLocale[] = '$1'.trim($localeBoolean).'$2';
2455
+                self::$functionReplaceToLocale[] = '$1' . trim($localeBoolean) . '$2';
2456 2456
             }
2457 2457
         }
2458 2458
 
@@ -2468,20 +2468,20 @@  discard block
 block discarded – undo
2468 2468
         if (self::$functionReplaceFromLocale === null) {
2469 2469
             self::$functionReplaceFromLocale = array();
2470 2470
             foreach (array_values(self::$localeFunctions) as $localeFunctionName) {
2471
-                self::$functionReplaceFromLocale[] = '/(@?[^\w\.])'.preg_quote($localeFunctionName).'([\s]*\()/Ui';
2471
+                self::$functionReplaceFromLocale[] = '/(@?[^\w\.])' . preg_quote($localeFunctionName) . '([\s]*\()/Ui';
2472 2472
             }
2473 2473
             foreach (array_values(self::$localeBoolean) as $excelBoolean) {
2474
-                self::$functionReplaceFromLocale[] = '/(@?[^\w\.])'.preg_quote($excelBoolean).'([^\w\.])/Ui';
2474
+                self::$functionReplaceFromLocale[] = '/(@?[^\w\.])' . preg_quote($excelBoolean) . '([^\w\.])/Ui';
2475 2475
             }
2476 2476
         }
2477 2477
 
2478 2478
         if (self::$functionReplaceToExcel === null) {
2479 2479
             self::$functionReplaceToExcel = array();
2480 2480
             foreach (array_keys(self::$localeFunctions) as $excelFunctionName) {
2481
-                self::$functionReplaceToExcel[] = '$1'.trim($excelFunctionName).'$2';
2481
+                self::$functionReplaceToExcel[] = '$1' . trim($excelFunctionName) . '$2';
2482 2482
             }
2483 2483
             foreach (array_keys(self::$localeBoolean) as $excelBoolean) {
2484
-                self::$functionReplaceToExcel[] = '$1'.trim($excelBoolean).'$2';
2484
+                self::$functionReplaceToExcel[] = '$1' . trim($excelBoolean) . '$2';
2485 2485
             }
2486 2486
         }
2487 2487
 
@@ -2517,12 +2517,12 @@  discard block
 block discarded – undo
2517 2517
     {
2518 2518
         if (is_string($value)) {
2519 2519
             //    Error values cannot be "wrapped"
2520
-            if (preg_match('/^'.self::CALCULATION_REGEXP_ERROR.'$/i', $value, $match)) {
2520
+            if (preg_match('/^' . self::CALCULATION_REGEXP_ERROR . '$/i', $value, $match)) {
2521 2521
                 //    Return Excel errors "as is"
2522 2522
                 return $value;
2523 2523
             }
2524 2524
             //    Return strings wrapped in quotes
2525
-            return '"'.$value.'"';
2525
+            return '"' . $value . '"';
2526 2526
         //    Convert numeric errors to NaN error
2527 2527
         } elseif ((is_float($value)) && ((is_nan($value)) || (is_infinite($value)))) {
2528 2528
             return Calculation\Functions::NAN();
@@ -2842,7 +2842,7 @@  discard block
 block discarded – undo
2842 2842
             //    Given two matrices of (potentially) unequal size, convert the larger in each dimension to match the smaller
2843 2843
             self::resizeMatricesShrink($operand1, $operand2, $matrix1Rows, $matrix1Columns, $matrix2Rows, $matrix2Columns);
2844 2844
         }
2845
-        return array( $matrix1Rows, $matrix1Columns, $matrix2Rows, $matrix2Columns);
2845
+        return array($matrix1Rows, $matrix1Columns, $matrix2Rows, $matrix2Columns);
2846 2846
     }
2847 2847
 
2848 2848
 
@@ -2928,14 +2928,14 @@  discard block
 block discarded – undo
2928 2928
         if (($matrix2Columns < $matrix1Columns) || ($matrix2Rows < $matrix1Rows)) {
2929 2929
             if ($matrix2Columns < $matrix1Columns) {
2930 2930
                 for ($i = 0; $i < $matrix2Rows; ++$i) {
2931
-                    $x = $matrix2[$i][$matrix2Columns-1];
2931
+                    $x = $matrix2[$i][$matrix2Columns - 1];
2932 2932
                     for ($j = $matrix2Columns; $j < $matrix1Columns; ++$j) {
2933 2933
                         $matrix2[$i][$j] = $x;
2934 2934
                     }
2935 2935
                 }
2936 2936
             }
2937 2937
             if ($matrix2Rows < $matrix1Rows) {
2938
-                $x = $matrix2[$matrix2Rows-1];
2938
+                $x = $matrix2[$matrix2Rows - 1];
2939 2939
                 for ($i = 0; $i < $matrix1Rows; ++$i) {
2940 2940
                     $matrix2[$i] = $x;
2941 2941
                 }
@@ -2945,14 +2945,14 @@  discard block
 block discarded – undo
2945 2945
         if (($matrix1Columns < $matrix2Columns) || ($matrix1Rows < $matrix2Rows)) {
2946 2946
             if ($matrix1Columns < $matrix2Columns) {
2947 2947
                 for ($i = 0; $i < $matrix1Rows; ++$i) {
2948
-                    $x = $matrix1[$i][$matrix1Columns-1];
2948
+                    $x = $matrix1[$i][$matrix1Columns - 1];
2949 2949
                     for ($j = $matrix1Columns; $j < $matrix2Columns; ++$j) {
2950 2950
                         $matrix1[$i][$j] = $x;
2951 2951
                     }
2952 2952
                 }
2953 2953
             }
2954 2954
             if ($matrix1Rows < $matrix2Rows) {
2955
-                $x = $matrix1[$matrix1Rows-1];
2955
+                $x = $matrix1[$matrix1Rows - 1];
2956 2956
                 for ($i = 0; $i < $matrix2Rows; ++$i) {
2957 2957
                     $matrix1[$i] = $x;
2958 2958
                 }
@@ -2986,9 +2986,9 @@  discard block
 block discarded – undo
2986 2986
                         $returnMatrix[] = $this->showValue($row);
2987 2987
                     }
2988 2988
                 }
2989
-                return '{ '.implode($rpad, $returnMatrix).' }';
2989
+                return '{ ' . implode($rpad, $returnMatrix) . ' }';
2990 2990
             } elseif (is_string($value) && (trim($value, '"') == $value)) {
2991
-                return '"'.$value.'"';
2991
+                return '"' . $value . '"';
2992 2992
             } elseif (is_bool($value)) {
2993 2993
                 return ($value) ? self::$localeBoolean['TRUE'] : self::$localeBoolean['FALSE'];
2994 2994
             }
@@ -3025,12 +3025,12 @@  discard block
 block discarded – undo
3025 3025
                 if ($value == '') {
3026 3026
                     return 'an empty string';
3027 3027
                 } elseif ($value{0} == '#') {
3028
-                    return 'a '.$value.' error';
3028
+                    return 'a ' . $value . ' error';
3029 3029
                 } else {
3030 3030
                     $typeString = 'a string';
3031 3031
                 }
3032 3032
             }
3033
-            return $typeString.' with a value of '.$this->showValue($value);
3033
+            return $typeString . ' with a value of ' . $this->showValue($value);
3034 3034
         }
3035 3035
     }
3036 3036
 
@@ -3096,31 +3096,31 @@  discard block
 block discarded – undo
3096 3096
     //    Binary Operators
3097 3097
     //    These operators always work on two values
3098 3098
     //    Array key is the operator, the value indicates whether this is a left or right associative operator
3099
-    private static $operatorAssociativity    = array(
3100
-        '^' => 0,                                                            //    Exponentiation
3101
-        '*' => 0, '/' => 0,                                                 //    Multiplication and Division
3102
-        '+' => 0, '-' => 0,                                                    //    Addition and Subtraction
3103
-        '&' => 0,                                                            //    Concatenation
3104
-        '|' => 0, ':' => 0,                                                    //    Intersect and Range
3099
+    private static $operatorAssociativity = array(
3100
+        '^' => 0, //    Exponentiation
3101
+        '*' => 0, '/' => 0, //    Multiplication and Division
3102
+        '+' => 0, '-' => 0, //    Addition and Subtraction
3103
+        '&' => 0, //    Concatenation
3104
+        '|' => 0, ':' => 0, //    Intersect and Range
3105 3105
         '>' => 0, '<' => 0, '=' => 0, '>=' => 0, '<=' => 0, '<>' => 0        //    Comparison
3106 3106
     );
3107 3107
 
3108 3108
     //    Comparison (Boolean) Operators
3109 3109
     //    These operators work on two values, but always return a boolean result
3110
-    private static $comparisonOperators    = array('>' => true, '<' => true, '=' => true, '>=' => true, '<=' => true, '<>' => true);
3110
+    private static $comparisonOperators = array('>' => true, '<' => true, '=' => true, '>=' => true, '<=' => true, '<>' => true);
3111 3111
 
3112 3112
     //    Operator Precedence
3113 3113
     //    This list includes all valid operators, whether binary (including boolean) or unary (such as %)
3114 3114
     //    Array key is the operator, the value is its precedence
3115
-    private static $operatorPrecedence    = array(
3116
-        ':' => 8,                                                                //    Range
3117
-        '|' => 7,                                                                //    Intersect
3118
-        '~' => 6,                                                                //    Negation
3119
-        '%' => 5,                                                                //    Percentage
3120
-        '^' => 4,                                                                //    Exponentiation
3121
-        '*' => 3, '/' => 3,                                                     //    Multiplication and Division
3122
-        '+' => 2, '-' => 2,                                                        //    Addition and Subtraction
3123
-        '&' => 1,                                                                //    Concatenation
3115
+    private static $operatorPrecedence = array(
3116
+        ':' => 8, //    Range
3117
+        '|' => 7, //    Intersect
3118
+        '~' => 6, //    Negation
3119
+        '%' => 5, //    Percentage
3120
+        '^' => 4, //    Exponentiation
3121
+        '*' => 3, '/' => 3, //    Multiplication and Division
3122
+        '+' => 2, '-' => 2, //    Addition and Subtraction
3123
+        '&' => 1, //    Concatenation
3124 3124
         '>' => 0, '<' => 0, '=' => 0, '>=' => 0, '<=' => 0, '<>' => 0            //    Comparison
3125 3125
     );
3126 3126
 
@@ -3135,22 +3135,22 @@  discard block
 block discarded – undo
3135 3135
         //        so we store the parent worksheet so that we can re-attach it when necessary
3136 3136
         $pCellParent = ($pCell !== null) ? $pCell->getWorksheet() : null;
3137 3137
 
3138
-        $regexpMatchString = '/^('.self::CALCULATION_REGEXP_FUNCTION.
3139
-                               '|'.self::CALCULATION_REGEXP_CELLREF.
3140
-                               '|'.self::CALCULATION_REGEXP_NUMBER.
3141
-                               '|'.self::CALCULATION_REGEXP_STRING.
3142
-                               '|'.self::CALCULATION_REGEXP_OPENBRACE.
3143
-                               '|'.self::CALCULATION_REGEXP_NAMEDRANGE.
3144
-                               '|'.self::CALCULATION_REGEXP_ERROR.
3138
+        $regexpMatchString = '/^(' . self::CALCULATION_REGEXP_FUNCTION .
3139
+                               '|' . self::CALCULATION_REGEXP_CELLREF .
3140
+                               '|' . self::CALCULATION_REGEXP_NUMBER .
3141
+                               '|' . self::CALCULATION_REGEXP_STRING .
3142
+                               '|' . self::CALCULATION_REGEXP_OPENBRACE .
3143
+                               '|' . self::CALCULATION_REGEXP_NAMEDRANGE .
3144
+                               '|' . self::CALCULATION_REGEXP_ERROR .
3145 3145
                              ')/si';
3146 3146
 
3147 3147
         //    Start with initialisation
3148 3148
         $index = 0;
3149 3149
         $stack = new Calculation\Token\Stack;
3150 3150
         $output = array();
3151
-        $expectingOperator = false;                    //    We use this test in syntax-checking the expression to determine when a
3151
+        $expectingOperator = false; //    We use this test in syntax-checking the expression to determine when a
3152 3152
                                                     //        - is a negation or + is a positive operator rather than an operation
3153
-        $expectingOperand = false;                    //    We use this test in syntax-checking the expression to determine whether an operand
3153
+        $expectingOperand = false; //    We use this test in syntax-checking the expression to determine whether an operand
3154 3154
                                                     //        should be null in a function call
3155 3155
         //    The guts of the lexical parser
3156 3156
         //    Loop through the formula extracting each operator and operand in turn
@@ -3158,7 +3158,7 @@  discard block
 block discarded – undo
3158 3158
 //echo 'Assessing Expression '.substr($formula, $index), PHP_EOL;
3159 3159
             $opCharacter = $formula{$index};    //    Get the first character of the value at the current index position
3160 3160
 //echo 'Initial character of expression block is '.$opCharacter, PHP_EOL;
3161
-            if ((isset(self::$comparisonOperators[$opCharacter])) && (strlen($formula) > $index) && (isset(self::$comparisonOperators[$formula{$index+1}]))) {
3161
+            if ((isset(self::$comparisonOperators[$opCharacter])) && (strlen($formula) > $index) && (isset(self::$comparisonOperators[$formula{$index + 1}]))) {
3162 3162
                 $opCharacter .= $formula{++$index};
3163 3163
 //echo 'Initial character of expression block is comparison operator '.$opCharacter.PHP_EOL;
3164 3164
             }
@@ -3170,26 +3170,26 @@  discard block
 block discarded – undo
3170 3170
 
3171 3171
             if ($opCharacter == '-' && !$expectingOperator) {                //    Is it a negation instead of a minus?
3172 3172
 //echo 'Element is a Negation operator', PHP_EOL;
3173
-                $stack->push('Unary Operator', '~');                            //    Put a negation on the stack
3174
-                ++$index;                                                    //        and drop the negation symbol
3173
+                $stack->push('Unary Operator', '~'); //    Put a negation on the stack
3174
+                ++$index; //        and drop the negation symbol
3175 3175
             } elseif ($opCharacter == '%' && $expectingOperator) {
3176 3176
 //echo 'Element is a Percentage operator', PHP_EOL;
3177
-                $stack->push('Unary Operator', '%');                            //    Put a percentage on the stack
3177
+                $stack->push('Unary Operator', '%'); //    Put a percentage on the stack
3178 3178
                 ++$index;
3179 3179
             } elseif ($opCharacter == '+' && !$expectingOperator) {            //    Positive (unary plus rather than binary operator plus) can be discarded?
3180 3180
 //echo 'Element is a Positive number, not Plus operator', PHP_EOL;
3181
-                ++$index;                                                    //    Drop the redundant plus symbol
3181
+                ++$index; //    Drop the redundant plus symbol
3182 3182
             } elseif ((($opCharacter == '~') || ($opCharacter == '|')) && (!$isOperandOrFunction)) {    //    We have to explicitly deny a tilde or pipe, because they are legal
3183
-                return $this->raiseFormulaError("Formula Error: Illegal character '~'");                //        on the stack but not in the input expression
3183
+                return $this->raiseFormulaError("Formula Error: Illegal character '~'"); //        on the stack but not in the input expression
3184 3184
             } elseif ((isset(self::$operators[$opCharacter]) or $isOperandOrFunction) && $expectingOperator) {    //    Are we putting an operator on the stack?
3185 3185
 //echo 'Element with value '.$opCharacter.' is an Operator', PHP_EOL;
3186 3186
                 while ($stack->count() > 0 &&
3187 3187
                     ($o2 = $stack->last()) &&
3188 3188
                     isset(self::$operators[$o2['value']]) &&
3189 3189
                     @(self::$operatorAssociativity[$opCharacter] ? self::$operatorPrecedence[$opCharacter] < self::$operatorPrecedence[$o2['value']] : self::$operatorPrecedence[$opCharacter] <= self::$operatorPrecedence[$o2['value']])) {
3190
-                    $output[] = $stack->pop();                                //    Swap operands and higher precedence operators from the stack to the output
3190
+                    $output[] = $stack->pop(); //    Swap operands and higher precedence operators from the stack to the output
3191 3191
                 }
3192
-                $stack->push('Binary Operator', $opCharacter);    //    Finally put our current operator onto the stack
3192
+                $stack->push('Binary Operator', $opCharacter); //    Finally put our current operator onto the stack
3193 3193
                 ++$index;
3194 3194
                 $expectingOperator = false;
3195 3195
             } elseif ($opCharacter == ')' && $expectingOperator) {            //    Are we expecting to close a parenthesis?
@@ -3203,11 +3203,11 @@  discard block
 block discarded – undo
3203 3203
                     }
3204 3204
                 }
3205 3205
                 $d = $stack->last(2);
3206
-                if (preg_match('/^'.self::CALCULATION_REGEXP_FUNCTION.'$/i', $d['value'], $matches)) {    //    Did this parenthesis just close a function?
3207
-                    $functionName = $matches[1];                                        //    Get the function name
3206
+                if (preg_match('/^' . self::CALCULATION_REGEXP_FUNCTION . '$/i', $d['value'], $matches)) {    //    Did this parenthesis just close a function?
3207
+                    $functionName = $matches[1]; //    Get the function name
3208 3208
 //echo 'Closed Function is '.$functionName, PHP_EOL;
3209 3209
                     $d = $stack->pop();
3210
-                    $argumentCount = $d['value'];        //    See how many arguments there were (argument count is the next value stored on the stack)
3210
+                    $argumentCount = $d['value']; //    See how many arguments there were (argument count is the next value stored on the stack)
3211 3211
 //if ($argumentCount == 0) {
3212 3212
 //    echo 'With no arguments', PHP_EOL;
3213 3213
 //} elseif ($argumentCount == 1) {
@@ -3215,8 +3215,8 @@  discard block
 block discarded – undo
3215 3215
 //} else {
3216 3216
 //    echo 'With '.$argumentCount.' arguments', PHP_EOL;
3217 3217
 //}
3218
-                    $output[] = $d;                        //    Dump the argument count on the output
3219
-                    $output[] = $stack->pop();            //    Pop the function and push onto the output
3218
+                    $output[] = $d; //    Dump the argument count on the output
3219
+                    $output[] = $stack->pop(); //    Pop the function and push onto the output
3220 3220
                     if (isset(self::$controlFunctions[$functionName])) {
3221 3221
 //echo 'Built-in function '.$functionName, PHP_EOL;
3222 3222
                         $expectedArgumentCount = self::$controlFunctions[$functionName]['argumentCount'];
@@ -3235,7 +3235,7 @@  discard block
 block discarded – undo
3235 3235
 //echo '$expectedArgumentCount is between 0 and '.abs($expectedArgumentCount), PHP_EOL;
3236 3236
                             if ($argumentCount > abs($expectedArgumentCount)) {
3237 3237
                                 $argumentCountError = true;
3238
-                                $expectedArgumentCountString = 'no more than '.abs($expectedArgumentCount);
3238
+                                $expectedArgumentCountString = 'no more than ' . abs($expectedArgumentCount);
3239 3239
                             }
3240 3240
                         } else {
3241 3241
 //echo '$expectedArgumentCount is numeric '.$expectedArgumentCount, PHP_EOL;
@@ -3252,25 +3252,25 @@  discard block
 block discarded – undo
3252 3252
                             case '+':
3253 3253
                                 if ($argumentCount < $argMatch[1]) {
3254 3254
                                     $argumentCountError = true;
3255
-                                    $expectedArgumentCountString = $argMatch[1].' or more ';
3255
+                                    $expectedArgumentCountString = $argMatch[1] . ' or more ';
3256 3256
                                 }
3257 3257
                                 break;
3258 3258
                             case '-':
3259 3259
                                 if (($argumentCount < $argMatch[1]) || ($argumentCount > $argMatch[3])) {
3260 3260
                                     $argumentCountError = true;
3261
-                                    $expectedArgumentCountString = 'between '.$argMatch[1].' and '.$argMatch[3];
3261
+                                    $expectedArgumentCountString = 'between ' . $argMatch[1] . ' and ' . $argMatch[3];
3262 3262
                                 }
3263 3263
                                 break;
3264 3264
                             case ',':
3265 3265
                                 if (($argumentCount != $argMatch[1]) && ($argumentCount != $argMatch[3])) {
3266 3266
                                     $argumentCountError = true;
3267
-                                    $expectedArgumentCountString = 'either '.$argMatch[1].' or '.$argMatch[3];
3267
+                                    $expectedArgumentCountString = 'either ' . $argMatch[1] . ' or ' . $argMatch[3];
3268 3268
                                 }
3269 3269
                                 break;
3270 3270
                         }
3271 3271
                     }
3272 3272
                     if ($argumentCountError) {
3273
-                        return $this->raiseFormulaError("Formula Error: Wrong number of arguments for $functionName() function: $argumentCount given, ".$expectedArgumentCountString." expected");
3273
+                        return $this->raiseFormulaError("Formula Error: Wrong number of arguments for $functionName() function: $argumentCount given, " . $expectedArgumentCountString . " expected");
3274 3274
                     }
3275 3275
                 }
3276 3276
                 ++$index;
@@ -3280,7 +3280,7 @@  discard block
 block discarded – undo
3280 3280
                     if ($o2 === null) {
3281 3281
                         return $this->raiseFormulaError("Formula Error: Unexpected ,");
3282 3282
                     } else {
3283
-                        $output[] = $o2;    // pop the argument expression stuff and push onto the output
3283
+                        $output[] = $o2; // pop the argument expression stuff and push onto the output
3284 3284
                     }
3285 3285
                 }
3286 3286
                 //    If we've a comma when we're expecting an operand, then what we actually have is a null operand;
@@ -3290,12 +3290,12 @@  discard block
 block discarded – undo
3290 3290
                 }
3291 3291
                 // make sure there was a function
3292 3292
                 $d = $stack->last(2);
3293
-                if (!preg_match('/^'.self::CALCULATION_REGEXP_FUNCTION.'$/i', $d['value'], $matches)) {
3293
+                if (!preg_match('/^' . self::CALCULATION_REGEXP_FUNCTION . '$/i', $d['value'], $matches)) {
3294 3294
                     return $this->raiseFormulaError("Formula Error: Unexpected ,");
3295 3295
                 }
3296 3296
                 $d = $stack->pop();
3297
-                $stack->push($d['type'], ++$d['value'], $d['reference']);    // increment the argument count
3298
-                $stack->push('Brace', '(');    // put the ( back on, we'll need to pop back to it again
3297
+                $stack->push($d['type'], ++$d['value'], $d['reference']); // increment the argument count
3298
+                $stack->push('Brace', '('); // put the ( back on, we'll need to pop back to it again
3299 3299
                 $expectingOperator = false;
3300 3300
                 $expectingOperand = true;
3301 3301
                 ++$index;
@@ -3310,24 +3310,24 @@  discard block
 block discarded – undo
3310 3310
                 $length = strlen($val);
3311 3311
 //                echo 'Element with value '.$val.' is an Operand, Variable, Constant, String, Number, Cell Reference or Function<br />';
3312 3312
 
3313
-                if (preg_match('/^'.self::CALCULATION_REGEXP_FUNCTION.'$/i', $val, $matches)) {
3313
+                if (preg_match('/^' . self::CALCULATION_REGEXP_FUNCTION . '$/i', $val, $matches)) {
3314 3314
                     $val = preg_replace('/\s/u', '', $val);
3315 3315
 //                    echo 'Element '.$val.' is a Function<br />';
3316 3316
                     if (isset(self::$phpSpreadsheetFunctions[strtoupper($matches[1])]) || isset(self::$controlFunctions[strtoupper($matches[1])])) {    // it's a function
3317 3317
                         $stack->push('Function', strtoupper($val));
3318
-                        $ax = preg_match('/^\s*(\s*\))/ui', substr($formula, $index+$length), $amatch);
3318
+                        $ax = preg_match('/^\s*(\s*\))/ui', substr($formula, $index + $length), $amatch);
3319 3319
                         if ($ax) {
3320
-                            $stack->push('Operand Count for Function '.strtoupper($val).')', 0);
3320
+                            $stack->push('Operand Count for Function ' . strtoupper($val) . ')', 0);
3321 3321
                             $expectingOperator = true;
3322 3322
                         } else {
3323
-                            $stack->push('Operand Count for Function '.strtoupper($val).')', 1);
3323
+                            $stack->push('Operand Count for Function ' . strtoupper($val) . ')', 1);
3324 3324
                             $expectingOperator = false;
3325 3325
                         }
3326 3326
                         $stack->push('Brace', '(');
3327 3327
                     } else {    // it's a var w/ implicit multiplication
3328 3328
                         $output[] = array('type' => 'Value', 'value' => $matches[1], 'reference' => null);
3329 3329
                     }
3330
-                } elseif (preg_match('/^'.self::CALCULATION_REGEXP_CELLREF.'$/i', $val, $matches)) {
3330
+                } elseif (preg_match('/^' . self::CALCULATION_REGEXP_CELLREF . '$/i', $val, $matches)) {
3331 3331
 //                    echo 'Element '.$val.' is a Cell reference<br />';
3332 3332
                     //    Watch for this case-change when modifying to allow cell references in different worksheets...
3333 3333
                     //    Should only be applied to the actual cell column, not the worksheet name
@@ -3339,10 +3339,10 @@  discard block
 block discarded – undo
3339 3339
                         if ($matches[2] == '') {
3340 3340
                             //    Otherwise, we 'inherit' the worksheet reference from the start cell reference
3341 3341
                             //    The start of the cell range reference should be the last entry in $output
3342
-                            $startCellRef = $output[count($output)-1]['value'];
3343
-                            preg_match('/^'.self::CALCULATION_REGEXP_CELLREF.'$/i', $startCellRef, $startMatches);
3342
+                            $startCellRef = $output[count($output) - 1]['value'];
3343
+                            preg_match('/^' . self::CALCULATION_REGEXP_CELLREF . '$/i', $startCellRef, $startMatches);
3344 3344
                             if ($startMatches[2] > '') {
3345
-                                $val = $startMatches[2].'!'.$val;
3345
+                                $val = $startMatches[2] . '!' . $val;
3346 3346
                             }
3347 3347
                         } else {
3348 3348
                             return $this->raiseFormulaError("3D Range references are not yet supported");
@@ -3356,7 +3356,7 @@  discard block
 block discarded – undo
3356 3356
                     //    If the last entry on the stack was a : operator, then we may have a row or column range reference
3357 3357
                     $testPrevOp = $stack->last(1);
3358 3358
                     if ($testPrevOp['value'] == ':') {
3359
-                        $startRowColRef = $output[count($output)-1]['value'];
3359
+                        $startRowColRef = $output[count($output) - 1]['value'];
3360 3360
                         $rangeWS1 = '';
3361 3361
                         if (strpos('!', $startRowColRef) !== false) {
3362 3362
                             list($rangeWS1, $startRowColRef) = explode('!', $startRowColRef);
@@ -3374,15 +3374,15 @@  discard block
 block discarded – undo
3374 3374
                         if ((is_integer($startRowColRef)) && (ctype_digit($val)) &&
3375 3375
                             ($startRowColRef <= 1048576) && ($val <= 1048576)) {
3376 3376
                             //    Row range
3377
-                            $endRowColRef = ($pCellParent !== null) ? $pCellParent->getHighestColumn() : 'XFD';    //    Max 16,384 columns for Excel2007
3378
-                            $output[count($output)-1]['value'] = $rangeWS1.'A'.$startRowColRef;
3379
-                            $val = $rangeWS2.$endRowColRef.$val;
3377
+                            $endRowColRef = ($pCellParent !== null) ? $pCellParent->getHighestColumn() : 'XFD'; //    Max 16,384 columns for Excel2007
3378
+                            $output[count($output) - 1]['value'] = $rangeWS1 . 'A' . $startRowColRef;
3379
+                            $val = $rangeWS2 . $endRowColRef . $val;
3380 3380
                         } elseif ((ctype_alpha($startRowColRef)) && (ctype_alpha($val)) &&
3381 3381
                             (strlen($startRowColRef) <= 3) && (strlen($val) <= 3)) {
3382 3382
                             //    Column range
3383
-                            $endRowColRef = ($pCellParent !== null) ? $pCellParent->getHighestRow() : 1048576;        //    Max 1,048,576 rows for Excel2007
3384
-                            $output[count($output)-1]['value'] = $rangeWS1.strtoupper($startRowColRef).'1';
3385
-                            $val = $rangeWS2.$val.$endRowColRef;
3383
+                            $endRowColRef = ($pCellParent !== null) ? $pCellParent->getHighestRow() : 1048576; //    Max 1,048,576 rows for Excel2007
3384
+                            $output[count($output) - 1]['value'] = $rangeWS1 . strtoupper($startRowColRef) . '1';
3385
+                            $val = $rangeWS2 . $val . $endRowColRef;
3386 3386
                         }
3387 3387
                     }
3388 3388
 
@@ -3451,16 +3451,16 @@  discard block
 block discarded – undo
3451 3451
                 //    If we're expecting an operator, but only have a space between the previous and next operands (and both are
3452 3452
                 //        Cell References) then we have an INTERSECTION operator
3453 3453
 //                echo 'Possible Intersect Operator<br />';
3454
-                if (($expectingOperator) && (preg_match('/^'.self::CALCULATION_REGEXP_CELLREF.'.*/Ui', substr($formula, $index), $match)) &&
3455
-                    ($output[count($output)-1]['type'] == 'Cell Reference')) {
3454
+                if (($expectingOperator) && (preg_match('/^' . self::CALCULATION_REGEXP_CELLREF . '.*/Ui', substr($formula, $index), $match)) &&
3455
+                    ($output[count($output) - 1]['type'] == 'Cell Reference')) {
3456 3456
 //                    echo 'Element is an Intersect Operator<br />';
3457 3457
                     while ($stack->count() > 0 &&
3458 3458
                         ($o2 = $stack->last()) &&
3459 3459
                         isset(self::$operators[$o2['value']]) &&
3460 3460
                         @(self::$operatorAssociativity[$opCharacter] ? self::$operatorPrecedence[$opCharacter] < self::$operatorPrecedence[$o2['value']] : self::$operatorPrecedence[$opCharacter] <= self::$operatorPrecedence[$o2['value']])) {
3461
-                        $output[] = $stack->pop();                                //    Swap operands and higher precedence operators from the stack to the output
3461
+                        $output[] = $stack->pop(); //    Swap operands and higher precedence operators from the stack to the output
3462 3462
                     }
3463
-                    $stack->push('Binary Operator', '|');    //    Put an Intersect Operator on the stack
3463
+                    $stack->push('Binary Operator', '|'); //    Put an Intersect Operator on the stack
3464 3464
                     $expectingOperator = false;
3465 3465
                 }
3466 3466
             }
@@ -3468,7 +3468,7 @@  discard block
 block discarded – undo
3468 3468
 
3469 3469
         while (($op = $stack->pop()) !== null) {    // pop everything off the stack and push onto output
3470 3470
             if ((is_array($op) && $op['value'] == '(') || ($op === '(')) {
3471
-                return $this->raiseFormulaError("Formula Error: Expecting ')'");    // if there are any opening braces on the stack, then braces were unbalanced
3471
+                return $this->raiseFormulaError("Formula Error: Expecting ')'"); // if there are any opening braces on the stack, then braces were unbalanced
3472 3472
             }
3473 3473
             $output[] = $op;
3474 3474
         }
@@ -3485,7 +3485,7 @@  discard block
 block discarded – undo
3485 3485
             $cKeys = array_keys(array_keys($operand[$rowKey]));
3486 3486
             $colKey = array_shift($cKeys);
3487 3487
             if (ctype_upper($colKey)) {
3488
-                $operandData['reference'] = $colKey.$rowKey;
3488
+                $operandData['reference'] = $colKey . $rowKey;
3489 3489
             }
3490 3490
         }
3491 3491
         return $operand;
@@ -3558,20 +3558,20 @@  discard block
 block discarded – undo
3558 3558
                         if ($sheet1 == $sheet2) {
3559 3559
                             if ($operand1Data['reference'] === null) {
3560 3560
                                 if ((trim($operand1Data['value']) != '') && (is_numeric($operand1Data['value']))) {
3561
-                                    $operand1Data['reference'] = $pCell->getColumn().$operand1Data['value'];
3561
+                                    $operand1Data['reference'] = $pCell->getColumn() . $operand1Data['value'];
3562 3562
                                 } elseif (trim($operand1Data['reference']) == '') {
3563 3563
                                     $operand1Data['reference'] = $pCell->getCoordinate();
3564 3564
                                 } else {
3565
-                                    $operand1Data['reference'] = $operand1Data['value'].$pCell->getRow();
3565
+                                    $operand1Data['reference'] = $operand1Data['value'] . $pCell->getRow();
3566 3566
                                 }
3567 3567
                             }
3568 3568
                             if ($operand2Data['reference'] === null) {
3569 3569
                                 if ((trim($operand2Data['value']) != '') && (is_numeric($operand2Data['value']))) {
3570
-                                    $operand2Data['reference'] = $pCell->getColumn().$operand2Data['value'];
3570
+                                    $operand2Data['reference'] = $pCell->getColumn() . $operand2Data['value'];
3571 3571
                                 } elseif (trim($operand2Data['reference']) == '') {
3572 3572
                                     $operand2Data['reference'] = $pCell->getCoordinate();
3573 3573
                                 } else {
3574
-                                    $operand2Data['reference'] = $operand2Data['value'].$pCell->getRow();
3574
+                                    $operand2Data['reference'] = $operand2Data['value'] . $pCell->getRow();
3575 3575
                                 }
3576 3576
                             }
3577 3577
 
@@ -3582,7 +3582,7 @@  discard block
 block discarded – undo
3582 3582
                                 $oCol[] = Cell::columnIndexFromString($oCR[0]) - 1;
3583 3583
                                 $oRow[] = $oCR[1];
3584 3584
                             }
3585
-                            $cellRef = Cell::stringFromColumnIndex(min($oCol)).min($oRow).':'.Cell::stringFromColumnIndex(max($oCol)).max($oRow);
3585
+                            $cellRef = Cell::stringFromColumnIndex(min($oCol)) . min($oRow) . ':' . Cell::stringFromColumnIndex(max($oCol)) . max($oRow);
3586 3586
                             if ($pCellParent !== null) {
3587 3587
                                 $cellValue = $this->extractCellRange($cellRef, $this->spreadsheet->getSheetByName($sheet1), false);
3588 3588
                             } else {
@@ -3632,7 +3632,7 @@  discard block
 block discarded – undo
3632 3632
                                 $result = '#VALUE!';
3633 3633
                             }
3634 3634
                         } else {
3635
-                            $result = '"'.str_replace('""', '"', self::unwrapResult($operand1, '"').self::unwrapResult($operand2, '"')).'"';
3635
+                            $result = '"' . str_replace('""', '"', self::unwrapResult($operand1, '"') . self::unwrapResult($operand2, '"')) . '"';
3636 3636
                         }
3637 3637
                         $this->_debugLog->writeDebugLog('Evaluation Result is ', $this->showTypeDetails($result));
3638 3638
                         $stack->push('Value', $result);
@@ -3647,7 +3647,7 @@  discard block
 block discarded – undo
3647 3647
                                 $cellIntersect[$row] = array_intersect_key($operand1[$row], $operand2[$row]);
3648 3648
                             }
3649 3649
                         }
3650
-                        $cellRef = Cell::stringFromColumnIndex(min($oCol)).min($oRow).':'.Cell::stringFromColumnIndex(max($oCol)).max($oRow);
3650
+                        $cellRef = Cell::stringFromColumnIndex(min($oCol)) . min($oRow) . ':' . Cell::stringFromColumnIndex(max($oCol)) . max($oRow);
3651 3651
                         $this->_debugLog->writeDebugLog('Evaluation Result is ', $this->showTypeDetails($cellIntersect));
3652 3652
                         $stack->push('Value', $cellIntersect, $cellRef);
3653 3653
                         break;
@@ -3684,7 +3684,7 @@  discard block
 block discarded – undo
3684 3684
                 } else {
3685 3685
                     $this->executeNumericBinaryOperation($cellID, $multiplier, $arg, '*', 'arrayTimesEquals', $stack);
3686 3686
                 }
3687
-            } elseif (preg_match('/^'.self::CALCULATION_REGEXP_CELLREF.'$/i', $token, $matches)) {
3687
+            } elseif (preg_match('/^' . self::CALCULATION_REGEXP_CELLREF . '$/i', $token, $matches)) {
3688 3688
                 $cellRef = null;
3689 3689
 //                echo 'Element '.$token.' is a Cell reference<br />';
3690 3690
                 if (isset($matches[8])) {
@@ -3693,7 +3693,7 @@  discard block
 block discarded – undo
3693 3693
 //                        We can't access the range, so return a REF error
3694 3694
                         $cellValue = Calculation\Functions::REF();
3695 3695
                     } else {
3696
-                        $cellRef = $matches[6].$matches[7].':'.$matches[9].$matches[10];
3696
+                        $cellRef = $matches[6] . $matches[7] . ':' . $matches[9] . $matches[10];
3697 3697
                         if ($matches[2] > '') {
3698 3698
                             $matches[2] = trim($matches[2], "\"'");
3699 3699
                             if ((strpos($matches[2], '[') !== false) || (strpos($matches[2], ']') !== false)) {
@@ -3727,7 +3727,7 @@  discard block
 block discarded – undo
3727 3727
 //                        We can't access the cell, so return a REF error
3728 3728
                         $cellValue = Calculation\Functions::REF();
3729 3729
                     } else {
3730
-                        $cellRef = $matches[6].$matches[7];
3730
+                        $cellRef = $matches[6] . $matches[7];
3731 3731
                         if ($matches[2] > '') {
3732 3732
                             $matches[2] = trim($matches[2], "\"'");
3733 3733
                             if ((strpos($matches[2], '[') !== false) || (strpos($matches[2], ']') !== false)) {
@@ -3765,7 +3765,7 @@  discard block
 block discarded – undo
3765 3765
                 $stack->push('Value', $cellValue, $cellRef);
3766 3766
 
3767 3767
             // if the token is a function, pop arguments off the stack, hand them to the function, and push the result back on
3768
-            } elseif (preg_match('/^'.self::CALCULATION_REGEXP_FUNCTION.'$/i', $token, $matches)) {
3768
+            } elseif (preg_match('/^' . self::CALCULATION_REGEXP_FUNCTION . '$/i', $token, $matches)) {
3769 3769
 //                echo 'Token is a function<br />';
3770 3770
                 $functionName = $matches[1];
3771 3771
                 $argCount = $stack->pop();
@@ -3822,7 +3822,7 @@  discard block
 block discarded – undo
3822 3822
                     if ($functionName != 'MKMATRIX') {
3823 3823
                         if ($this->_debugLog->getWriteDebugLog()) {
3824 3824
                             krsort($argArrayVals);
3825
-                            $this->_debugLog->writeDebugLog('Evaluating ', self::localeFunc($functionName), '( ', implode(self::$localeArgumentSeparator.' ', Calculation\Functions::flattenArray($argArrayVals)), ' )');
3825
+                            $this->_debugLog->writeDebugLog('Evaluating ', self::localeFunc($functionName), '( ', implode(self::$localeArgumentSeparator . ' ', Calculation\Functions::flattenArray($argArrayVals)), ' )');
3826 3826
                         }
3827 3827
                     }
3828 3828
                     //    Process each argument in turn, building the return value as an array
@@ -3877,7 +3877,7 @@  discard block
 block discarded – undo
3877 3877
 //                    echo 'Token is a number, boolean, string, null or an Excel error<br />';
3878 3878
                     $stack->push('Value', $token);
3879 3879
                 // if the token is a named range, push the named range name onto the stack
3880
-                } elseif (preg_match('/^'.self::CALCULATION_REGEXP_NAMEDRANGE.'$/i', $token, $matches)) {
3880
+                } elseif (preg_match('/^' . self::CALCULATION_REGEXP_NAMEDRANGE . '$/i', $token, $matches)) {
3881 3881
 //                    echo 'Token is a named range<br />';
3882 3882
                     $namedRange = $matches[6];
3883 3883
 //                    echo 'Named Range is '.$namedRange.'<br />';
@@ -4105,8 +4105,8 @@  discard block
 block discarded – undo
4105 4105
             }
4106 4106
         } else {
4107 4107
             if ((Calculation\Functions::getCompatibilityMode() != Calculation\Functions::COMPATIBILITY_OPENOFFICE) &&
4108
-                ((is_string($operand1) && !is_numeric($operand1) && strlen($operand1)>0) ||
4109
-                 (is_string($operand2) && !is_numeric($operand2) && strlen($operand2)>0))) {
4108
+                ((is_string($operand1) && !is_numeric($operand1) && strlen($operand1) > 0) ||
4109
+                 (is_string($operand2) && !is_numeric($operand2) && strlen($operand2) > 0))) {
4110 4110
                 $result = Calculation\Functions::VALUE();
4111 4111
             } else {
4112 4112
                 //    If we're dealing with non-matrix operations, execute the necessary operation
@@ -4174,7 +4174,7 @@  discard block
 block discarded – undo
4174 4174
     public function extractCellRange(&$pRange = 'A1', Worksheet $pSheet = null, $resetLog = true)
4175 4175
     {
4176 4176
         // Return value
4177
-        $returnValue = array ();
4177
+        $returnValue = array();
4178 4178
 
4179 4179
 //        echo 'extractCellRange('.$pRange.')', PHP_EOL;
4180 4180
         if ($pSheet !== null) {
@@ -4191,7 +4191,7 @@  discard block
 block discarded – undo
4191 4191
 
4192 4192
             // Extract range
4193 4193
             $aReferences = Cell::extractAllCellReferencesInRange($pRange);
4194
-            $pRange = $pSheetName.'!'.$pRange;
4194
+            $pRange = $pSheetName . '!' . $pRange;
4195 4195
             if (!isset($aReferences[1])) {
4196 4196
                 //    Single cell in range
4197 4197
                 sscanf($aReferences[0], '%[A-Z]%d', $currentCol, $currentRow);
@@ -4232,7 +4232,7 @@  discard block
 block discarded – undo
4232 4232
     public function extractNamedRange(&$pRange = 'A1', Worksheet $pSheet = null, $resetLog = true)
4233 4233
     {
4234 4234
         // Return value
4235
-        $returnValue = array ();
4235
+        $returnValue = array();
4236 4236
 
4237 4237
 //        echo 'extractNamedRange('.$pRange.')<br />';
4238 4238
         if ($pSheet !== null) {
Please login to merge, or discard this patch.