Completed
Push — develop ( 685e29...09d456 )
by Adrien
14:14
created
src/PhpSpreadsheet/Writer/CSV.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -116,10 +116,10 @@
 block discarded – undo
116 116
         }
117 117
 
118 118
         if ($this->excelCompatibility) {
119
-            $this->setUseBOM(true);                //  Enforce UTF-8 BOM Header
120
-            $this->setIncludeSeparatorLine(true);  //  Set separator line
121
-            $this->setEnclosure('"');              //  Set enclosure to "
122
-            $this->setDelimiter(';');              //  Set delimiter to a semi-colon
119
+            $this->setUseBOM(true); //  Enforce UTF-8 BOM Header
120
+            $this->setIncludeSeparatorLine(true); //  Set separator line
121
+            $this->setEnclosure('"'); //  Set enclosure to "
122
+            $this->setDelimiter(';'); //  Set delimiter to a semi-colon
123 123
             $this->setLineEnding("\r\n");
124 124
         }
125 125
         if ($this->useBOM) {
Please login to merge, or discard this patch.
src/PhpSpreadsheet/Writer/Excel5/Xf.php 1 patch
Spacing   +14 added lines, -14 removed lines patch added patch discarded remove patch
@@ -167,16 +167,16 @@  discard block
 block discarded – undo
167 167
         }
168 168
 
169 169
         // Flags to indicate if attributes have been set.
170
-        $atr_num = ($this->numberFormatIndex != 0)?1:0;
171
-        $atr_fnt = ($this->fontIndex != 0)?1:0;
170
+        $atr_num = ($this->numberFormatIndex != 0) ? 1 : 0;
171
+        $atr_fnt = ($this->fontIndex != 0) ? 1 : 0;
172 172
         $atr_alc = ((int) $this->_style->getAlignment()->getWrapText()) ? 1 : 0;
173 173
         $atr_bdr = (self::mapBorderStyle($this->_style->getBorders()->getBottom()->getBorderStyle()) ||
174 174
                         self::mapBorderStyle($this->_style->getBorders()->getTop()->getBorderStyle()) ||
175 175
                         self::mapBorderStyle($this->_style->getBorders()->getLeft()->getBorderStyle()) ||
176
-                        self::mapBorderStyle($this->_style->getBorders()->getRight()->getBorderStyle()))?1:0;
176
+                        self::mapBorderStyle($this->_style->getBorders()->getRight()->getBorderStyle())) ? 1 : 0;
177 177
         $atr_pat = (($this->foregroundColor != 0x40) ||
178 178
                         ($this->backgroundColor != 0x41) ||
179
-                        self::mapFillType($this->_style->getFill()->getFillType()))?1:0;
179
+                        self::mapFillType($this->_style->getFill()->getFillType())) ? 1 : 0;
180 180
         $atr_prot = self::mapLocked($this->_style->getProtection()->getLocked())
181 181
                         | self::mapHidden($this->_style->getProtection()->getHidden());
182 182
 
@@ -197,13 +197,13 @@  discard block
 block discarded – undo
197 197
             $this->_diag_color = 0;
198 198
         }
199 199
 
200
-        $record = 0x00E0;              // Record identifier
201
-        $length = 0x0014;              // Number of bytes to follow
200
+        $record = 0x00E0; // Record identifier
201
+        $length = 0x0014; // Number of bytes to follow
202 202
 
203
-        $ifnt = $this->fontIndex;   // Index to FONT record
204
-        $ifmt = $this->numberFormatIndex;  // Index to FORMAT record
203
+        $ifnt = $this->fontIndex; // Index to FONT record
204
+        $ifmt = $this->numberFormatIndex; // Index to FORMAT record
205 205
 
206
-        $align = $this->mapHAlign($this->_style->getAlignment()->getHorizontal());       // Alignment
206
+        $align = $this->mapHAlign($this->_style->getAlignment()->getHorizontal()); // Alignment
207 207
         $align |= (int) $this->_style->getAlignment()->getWrapText() << 3;
208 208
         $align |= self::mapVAlign($this->_style->getAlignment()->getVertical()) << 4;
209 209
         $align |= $this->textJustLast << 7;
@@ -215,10 +215,10 @@  discard block
 block discarded – undo
215 215
         $used_attrib |= $atr_pat << 6;
216 216
         $used_attrib |= $atr_prot << 7;
217 217
 
218
-        $icv = $this->foregroundColor;      // fg and bg pattern colors
218
+        $icv = $this->foregroundColor; // fg and bg pattern colors
219 219
         $icv |= $this->backgroundColor << 7;
220 220
 
221
-        $border1 = self::mapBorderStyle($this->_style->getBorders()->getLeft()->getBorderStyle());          // Border line style and color
221
+        $border1 = self::mapBorderStyle($this->_style->getBorders()->getLeft()->getBorderStyle()); // Border line style and color
222 222
         $border1 |= self::mapBorderStyle($this->_style->getBorders()->getRight()->getBorderStyle()) << 4;
223 223
         $border1 |= self::mapBorderStyle($this->_style->getBorders()->getTop()->getBorderStyle()) << 8;
224 224
         $border1 |= self::mapBorderStyle($this->_style->getBorders()->getBottom()->getBorderStyle()) << 12;
@@ -233,7 +233,7 @@  discard block
 block discarded – undo
233 233
         $border1 |= $diag_tl_to_rb << 30;
234 234
         $border1 |= $diag_tr_to_lb << 31;
235 235
 
236
-        $border2 = $this->topBorderColor;    // Border color
236
+        $border2 = $this->topBorderColor; // Border color
237 237
         $border2 |= $this->bottomBorderColor << 7;
238 238
         $border2 |= $this->_diag_color << 14;
239 239
         $border2 |= self::mapBorderStyle($this->_style->getBorders()->getDiagonal()->getBorderStyle()) << 21;
@@ -413,8 +413,8 @@  discard block
 block discarded – undo
413 413
         \PhpSpreadsheet\Style\Fill::FILL_PATTERN_LIGHTTRELLIS => 0x10,
414 414
         \PhpSpreadsheet\Style\Fill::FILL_PATTERN_GRAY125 => 0x11,
415 415
         \PhpSpreadsheet\Style\Fill::FILL_PATTERN_GRAY0625 => 0x12,
416
-        \PhpSpreadsheet\Style\Fill::FILL_GRADIENT_LINEAR => 0x00,    // does not exist in BIFF8
417
-        \PhpSpreadsheet\Style\Fill::FILL_GRADIENT_PATH => 0x00,    // does not exist in BIFF8
416
+        \PhpSpreadsheet\Style\Fill::FILL_GRADIENT_LINEAR => 0x00, // does not exist in BIFF8
417
+        \PhpSpreadsheet\Style\Fill::FILL_GRADIENT_PATH => 0x00, // does not exist in BIFF8
418 418
     ];
419 419
 
420 420
     /**
Please login to merge, or discard this patch.
src/PhpSpreadsheet/Writer/Excel5/BIFFwriter.php 1 patch
Spacing   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -110,9 +110,9 @@  discard block
 block discarded – undo
110 110
             $teststr = pack('d', 1.2345);
111 111
             $number = pack('C8', 0x8D, 0x97, 0x6E, 0x12, 0x83, 0xC0, 0xF3, 0x3F);
112 112
             if ($number == $teststr) {
113
-                $byte_order = 0;    // Little Endian
113
+                $byte_order = 0; // Little Endian
114 114
             } elseif ($number == strrev($teststr)) {
115
-                $byte_order = 1;    // Big Endian
115
+                $byte_order = 1; // Big Endian
116 116
             } else {
117 117
                 // Give up. I'll fix this in a later version.
118 118
                 throw new \PhpSpreadsheet\Writer\Exception('Required floating point format not supported on this platform.');
@@ -162,16 +162,16 @@  discard block
 block discarded – undo
162 162
      */
163 163
     protected function storeBof($type)
164 164
     {
165
-        $record = 0x0809;            // Record identifier    (BIFF5-BIFF8)
165
+        $record = 0x0809; // Record identifier    (BIFF5-BIFF8)
166 166
         $length = 0x0010;
167 167
 
168 168
         // by inspection of real files, MS Office Excel 2007 writes the following
169 169
         $unknown = pack('VV', 0x000100D1, 0x00000406);
170 170
 
171
-        $build = 0x0DBB;            //    Excel 97
172
-        $year = 0x07CC;            //    Excel 97
171
+        $build = 0x0DBB; //    Excel 97
172
+        $year = 0x07CC; //    Excel 97
173 173
 
174
-        $version = 0x0600;            //    BIFF8
174
+        $version = 0x0600; //    BIFF8
175 175
 
176 176
         $header = pack('vv', $record, $length);
177 177
         $data = pack('vvvv', $version, $type, $build, $year);
@@ -183,8 +183,8 @@  discard block
 block discarded – undo
183 183
      */
184 184
     protected function storeEof()
185 185
     {
186
-        $record = 0x000A;   // Record identifier
187
-        $length = 0x0000;   // Number of bytes to follow
186
+        $record = 0x000A; // Record identifier
187
+        $length = 0x0000; // Number of bytes to follow
188 188
 
189 189
         $header = pack('vv', $record, $length);
190 190
         $this->append($header);
@@ -195,8 +195,8 @@  discard block
 block discarded – undo
195 195
      */
196 196
     public function writeEof()
197 197
     {
198
-        $record = 0x000A;   // Record identifier
199
-        $length = 0x0000;   // Number of bytes to follow
198
+        $record = 0x000A; // Record identifier
199
+        $length = 0x0000; // Number of bytes to follow
200 200
         $header = pack('vv', $record, $length);
201 201
 
202 202
         return $this->writeData($header);
@@ -216,13 +216,13 @@  discard block
 block discarded – undo
216 216
     private function addContinue($data)
217 217
     {
218 218
         $limit = $this->limit;
219
-        $record = 0x003C;         // Record identifier
219
+        $record = 0x003C; // Record identifier
220 220
 
221 221
         // The first 2080/8224 bytes remain intact. However, we have to change
222 222
         // the length field of the record.
223 223
         $tmp = substr($data, 0, 2) . pack('v', $limit) . substr($data, 4, $limit);
224 224
 
225
-        $header = pack('vv', $record, $limit);  // Headers for continue records
225
+        $header = pack('vv', $record, $limit); // Headers for continue records
226 226
 
227 227
         // Retrieve chunks of 2080/8224 bytes +4 for the header.
228 228
         $data_length = strlen($data);
Please login to merge, or discard this patch.
src/PhpSpreadsheet/Writer/Excel5/Worksheet.php 2 patches
Indentation   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -1020,8 +1020,8 @@  discard block
 block discarded – undo
1020 1020
 
1021 1021
         // Write the packed data
1022 1022
         $this->append($header . $data .
1023
-                       $unknown1 . $options .
1024
-                       $unknown2 . $url_len . $url);
1023
+                        $unknown1 . $options .
1024
+                        $unknown2 . $url_len . $url);
1025 1025
 
1026 1026
         return 0;
1027 1027
     }
@@ -1069,8 +1069,8 @@  discard block
 block discarded – undo
1069 1069
 
1070 1070
         // Write the packed data
1071 1071
         $this->append($header . $data .
1072
-                       $unknown1 . $options .
1073
-                       $url_len . $url);
1072
+                        $unknown1 . $options .
1073
+                        $url_len . $url);
1074 1074
 
1075 1075
         return 0;
1076 1076
     }
@@ -1151,14 +1151,14 @@  discard block
 block discarded – undo
1151 1151
 
1152 1152
         // Pack the main data stream
1153 1153
         $data = pack('vvvv', $row1, $row2, $col1, $col2) .
1154
-                          $unknown1 .
1155
-                          $link_type .
1156
-                          $unknown2 .
1157
-                          $up_count .
1158
-                          $dir_short_len .
1159
-                          $dir_short .
1160
-                          $unknown3 .
1161
-                          $stream_len;/*.
1154
+                            $unknown1 .
1155
+                            $link_type .
1156
+                            $unknown2 .
1157
+                            $up_count .
1158
+                            $dir_short_len .
1159
+                            $dir_short .
1160
+                            $unknown3 .
1161
+                            $stream_len;/*.
1162 1162
                           $dir_long_len .
1163 1163
                           $unknown4     .
1164 1164
                           $dir_long     .
Please login to merge, or discard this patch.
Spacing   +219 added lines, -219 removed lines patch added patch discarded remove patch
@@ -542,7 +542,7 @@  discard block
 block discarded – undo
542 542
         }
543 543
 
544 544
         $firstCellCoordinates = \PhpSpreadsheet\Cell::coordinateFromString($firstCell); // e.g. array(0, 1)
545
-        $lastCellCoordinates = \PhpSpreadsheet\Cell::coordinateFromString($lastCell);  // e.g. array(1, 6)
545
+        $lastCellCoordinates = \PhpSpreadsheet\Cell::coordinateFromString($lastCell); // e.g. array(1, 6)
546 546
 
547 547
         return pack('vvvv', $firstCellCoordinates[1] - 1, $lastCellCoordinates[1] - 1, \PhpSpreadsheet\Cell::columnIndexFromString($firstCellCoordinates[0]) - 1, \PhpSpreadsheet\Cell::columnIndexFromString($lastCellCoordinates[0]) - 1);
548 548
     }
@@ -616,8 +616,8 @@  discard block
 block discarded – undo
616 616
      */
617 617
     private function writeNumber($row, $col, $num, $xfIndex)
618 618
     {
619
-        $record = 0x0203;                 // Record identifier
620
-        $length = 0x000E;                 // Number of bytes to follow
619
+        $record = 0x0203; // Record identifier
620
+        $length = 0x000E; // Number of bytes to follow
621 621
 
622 622
         $header = pack('vv', $record, $length);
623 623
         $data = pack('vvv', $row, $col, $xfIndex);
@@ -655,8 +655,8 @@  discard block
 block discarded – undo
655 655
      */
656 656
     private function writeRichTextString($row, $col, $str, $xfIndex, $arrcRun)
657 657
     {
658
-        $record = 0x00FD;                   // Record identifier
659
-        $length = 0x000A;                   // Bytes to follow
658
+        $record = 0x00FD; // Record identifier
659
+        $length = 0x000A; // Bytes to follow
660 660
         $str = \PhpSpreadsheet\Shared\StringHelper::UTF8toBIFF8UnicodeShort($str, $arrcRun);
661 661
 
662 662
         /* check if string is already present */
@@ -687,8 +687,8 @@  discard block
 block discarded – undo
687 687
     private function writeLabel($row, $col, $str, $xfIndex)
688 688
     {
689 689
         $strlen = strlen($str);
690
-        $record = 0x0204;                   // Record identifier
691
-        $length = 0x0008 + $strlen;         // Bytes to follow
690
+        $record = 0x0204; // Record identifier
691
+        $length = 0x0008 + $strlen; // Bytes to follow
692 692
 
693 693
         $str_error = 0;
694 694
 
@@ -722,8 +722,8 @@  discard block
 block discarded – undo
722 722
      */
723 723
     private function writeLabelSst($row, $col, $str, $xfIndex)
724 724
     {
725
-        $record = 0x00FD;                   // Record identifier
726
-        $length = 0x000A;                   // Bytes to follow
725
+        $record = 0x00FD; // Record identifier
726
+        $length = 0x000A; // Bytes to follow
727 727
 
728 728
         $str = \PhpSpreadsheet\Shared\StringHelper::UTF8toBIFF8UnicodeLong($str);
729 729
 
@@ -749,8 +749,8 @@  discard block
 block discarded – undo
749 749
     private function writeNote($row, $col, $note)
750 750
     {
751 751
         $note_length = strlen($note);
752
-        $record = 0x001C;            // Record identifier
753
-        $max_length = 2048;                // Maximun length for a NOTE record
752
+        $record = 0x001C; // Record identifier
753
+        $max_length = 2048; // Maximun length for a NOTE record
754 754
 
755 755
         // Length for this record is no more than 2048 + 6
756 756
         $length = 0x0006 + min($note_length, 2048);
@@ -787,8 +787,8 @@  discard block
 block discarded – undo
787 787
      */
788 788
     public function writeBlank($row, $col, $xfIndex)
789 789
     {
790
-        $record = 0x0201;                 // Record identifier
791
-        $length = 0x0006;                 // Number of bytes to follow
790
+        $record = 0x0201; // Record identifier
791
+        $length = 0x0006; // Number of bytes to follow
792 792
 
793 793
         $header = pack('vv', $record, $length);
794 794
         $data = pack('vvv', $row, $col, $xfIndex);
@@ -836,7 +836,7 @@  discard block
 block discarded – undo
836 836
      */
837 837
     private function writeFormula($row, $col, $formula, $xfIndex, $calculatedValue)
838 838
     {
839
-        $record = 0x0006;     // Record identifier
839
+        $record = 0x0006; // Record identifier
840 840
 
841 841
         // Initialize possible additional value for STRING record that should be written after the FORMULA record?
842 842
         $stringValue = null;
@@ -871,8 +871,8 @@  discard block
 block discarded – undo
871 871
             $num = pack('d', 0x00);
872 872
         }
873 873
 
874
-        $grbit = 0x03;                // Option flags
875
-        $unknown = 0x0000;            // Must be zero
874
+        $grbit = 0x03; // Option flags
875
+        $unknown = 0x0000; // Must be zero
876 876
 
877 877
         // Strip the '=' or '@' sign at the beginning of the formula string
878 878
         if ($formula{0} == '=') {
@@ -889,8 +889,8 @@  discard block
 block discarded – undo
889 889
             $error = $this->parser->parse($formula);
890 890
             $formula = $this->parser->toReversePolish();
891 891
 
892
-            $formlen = strlen($formula);    // Length of the binary string
893
-            $length = 0x16 + $formlen;     // Length of the record data
892
+            $formlen = strlen($formula); // Length of the binary string
893
+            $length = 0x16 + $formlen; // Length of the record data
894 894
 
895 895
             $header = pack('vv', $record, $length);
896 896
 
@@ -917,7 +917,7 @@  discard block
 block discarded – undo
917 917
      */
918 918
     private function writeStringRecord($stringValue)
919 919
     {
920
-        $record = 0x0207;     // Record identifier
920
+        $record = 0x0207; // Record identifier
921 921
         $data = \PhpSpreadsheet\Shared\StringHelper::UTF8toBIFF8UnicodeLong($stringValue);
922 922
 
923 923
         $length = strlen($data);
@@ -994,8 +994,8 @@  discard block
 block discarded – undo
994 994
      */
995 995
     public function writeUrlWeb($row1, $col1, $row2, $col2, $url)
996 996
     {
997
-        $record = 0x01B8;                       // Record identifier
998
-        $length = 0x00000;                      // Bytes to follow
997
+        $record = 0x01B8; // Record identifier
998
+        $length = 0x00000; // Bytes to follow
999 999
 
1000 1000
         // Pack the undocumented parts of the hyperlink stream
1001 1001
         $unknown1 = pack('H*', 'D0C9EA79F9BACE118C8200AA004BA90B02000000');
@@ -1039,8 +1039,8 @@  discard block
 block discarded – undo
1039 1039
      */
1040 1040
     public function writeUrlInternal($row1, $col1, $row2, $col2, $url)
1041 1041
     {
1042
-        $record = 0x01B8;                       // Record identifier
1043
-        $length = 0x00000;                      // Bytes to follow
1042
+        $record = 0x01B8; // Record identifier
1043
+        $length = 0x00000; // Bytes to follow
1044 1044
 
1045 1045
         // Strip URL type
1046 1046
         $url = preg_replace('/^internal:/', '', $url);
@@ -1098,8 +1098,8 @@  discard block
 block discarded – undo
1098 1098
             return; //($this->writeUrlExternal_net($row1, $col1, $row2, $col2, $url, $str, $format));
1099 1099
         }
1100 1100
 
1101
-        $record = 0x01B8;                       // Record identifier
1102
-        $length = 0x00000;                      // Bytes to follow
1101
+        $record = 0x01B8; // Record identifier
1102
+        $length = 0x00000; // Bytes to follow
1103 1103
 
1104 1104
         // Strip URL type and change Unix dir separator to Dos style (if needed)
1105 1105
         //
@@ -1158,7 +1158,7 @@  discard block
 block discarded – undo
1158 1158
                           $dir_short_len .
1159 1159
                           $dir_short .
1160 1160
                           $unknown3 .
1161
-                          $stream_len;/*.
1161
+                          $stream_len; /*.
1162 1162
                           $dir_long_len .
1163 1163
                           $unknown4     .
1164 1164
                           $dir_long     .
@@ -1187,14 +1187,14 @@  discard block
 block discarded – undo
1187 1187
      */
1188 1188
     private function writeRow($row, $height, $xfIndex, $hidden = false, $level = 0)
1189 1189
     {
1190
-        $record = 0x0208;               // Record identifier
1191
-        $length = 0x0010;               // Number of bytes to follow
1192
-
1193
-        $colMic = 0x0000;               // First defined column
1194
-        $colMac = 0x0000;               // Last defined column
1195
-        $irwMac = 0x0000;               // Used by Excel to optimise loading
1196
-        $reserved = 0x0000;               // Reserved
1197
-        $grbit = 0x0000;               // Option flags
1190
+        $record = 0x0208; // Record identifier
1191
+        $length = 0x0010; // Number of bytes to follow
1192
+
1193
+        $colMic = 0x0000; // First defined column
1194
+        $colMac = 0x0000; // Last defined column
1195
+        $irwMac = 0x0000; // Used by Excel to optimise loading
1196
+        $reserved = 0x0000; // Reserved
1197
+        $grbit = 0x0000; // Option flags
1198 1198
         $ixfe = $xfIndex;
1199 1199
 
1200 1200
         if ($height < 0) {
@@ -1203,9 +1203,9 @@  discard block
 block discarded – undo
1203 1203
 
1204 1204
         // Use writeRow($row, null, $XF) to set XF format without setting height
1205 1205
         if ($height != null) {
1206
-            $miyRw = $height * 20;  // row height
1206
+            $miyRw = $height * 20; // row height
1207 1207
         } else {
1208
-            $miyRw = 0xff;          // default row height is 256
1208
+            $miyRw = 0xff; // default row height is 256
1209 1209
         }
1210 1210
 
1211 1211
         // Set the options flags. fUnsynced is used to show that the font and row
@@ -1250,26 +1250,26 @@  discard block
 block discarded – undo
1250 1250
      */
1251 1251
     private function writeWindow2()
1252 1252
     {
1253
-        $record = 0x023E;     // Record identifier
1253
+        $record = 0x023E; // Record identifier
1254 1254
         $length = 0x0012;
1255 1255
 
1256
-        $grbit = 0x00B6;     // Option flags
1257
-        $rwTop = 0x0000;     // Top row visible in window
1258
-        $colLeft = 0x0000;     // Leftmost column visible in window
1256
+        $grbit = 0x00B6; // Option flags
1257
+        $rwTop = 0x0000; // Top row visible in window
1258
+        $colLeft = 0x0000; // Leftmost column visible in window
1259 1259
 
1260 1260
         // The options flags that comprise $grbit
1261
-        $fDspFmla = 0;                     // 0 - bit
1261
+        $fDspFmla = 0; // 0 - bit
1262 1262
         $fDspGrid = $this->phpSheet->getShowGridlines() ? 1 : 0; // 1
1263 1263
         $fDspRwCol = $this->phpSheet->getShowRowColHeaders() ? 1 : 0; // 2
1264
-        $fFrozen = $this->phpSheet->getFreezePane() ? 1 : 0;        // 3
1265
-        $fDspZeros = 1;                     // 4
1266
-        $fDefaultHdr = 1;                     // 5
1264
+        $fFrozen = $this->phpSheet->getFreezePane() ? 1 : 0; // 3
1265
+        $fDspZeros = 1; // 4
1266
+        $fDefaultHdr = 1; // 5
1267 1267
         $fArabic = $this->phpSheet->getRightToLeft() ? 1 : 0; // 6
1268
-        $fDspGuts = $this->outlineOn;    // 7
1269
-        $fFrozenNoSplit = 0;                     // 0 - bit
1268
+        $fDspGuts = $this->outlineOn; // 7
1269
+        $fFrozenNoSplit = 0; // 0 - bit
1270 1270
         // no support in PhpSpreadsheet for selected sheet, therefore sheet is only selected if it is the active sheet
1271 1271
         $fSelected = ($this->phpSheet === $this->phpSheet->getParent()->getActiveSheet()) ? 1 : 0;
1272
-        $fPaged = 1;                     // 2
1272
+        $fPaged = 1; // 2
1273 1273
         $fPageBreakPreview = $this->phpSheet->getSheetView()->getView() === \PhpSpreadsheet\Worksheet\SheetView::SHEETVIEW_PAGE_BREAK_PREVIEW;
1274 1274
 
1275 1275
         $grbit = $fDspFmla;
@@ -1312,8 +1312,8 @@  discard block
 block discarded – undo
1312 1312
         // convert to twips
1313 1313
         $defaultRowHeight = (int) 20 * $defaultRowHeight;
1314 1314
 
1315
-        $record = 0x0225;      // Record identifier
1316
-        $length = 0x0004;      // Number of bytes to follow
1315
+        $record = 0x0225; // Record identifier
1316
+        $length = 0x0004; // Number of bytes to follow
1317 1317
 
1318 1318
         $header = pack('vv', $record, $length);
1319 1319
         $data = pack('vv', 1, $defaultRowHeight);
@@ -1327,8 +1327,8 @@  discard block
 block discarded – undo
1327 1327
     {
1328 1328
         $defaultColWidth = 8;
1329 1329
 
1330
-        $record = 0x0055;      // Record identifier
1331
-        $length = 0x0002;      // Number of bytes to follow
1330
+        $record = 0x0055; // Record identifier
1331
+        $length = 0x0002; // Number of bytes to follow
1332 1332
 
1333 1333
         $header = pack('vv', $record, $length);
1334 1334
         $data = pack('v', $defaultColWidth);
@@ -1377,13 +1377,13 @@  discard block
 block discarded – undo
1377 1377
         } else {
1378 1378
             $level = 0;
1379 1379
         }
1380
-        $record = 0x007D;          // Record identifier
1381
-        $length = 0x000C;          // Number of bytes to follow
1380
+        $record = 0x007D; // Record identifier
1381
+        $length = 0x000C; // Number of bytes to follow
1382 1382
 
1383
-        $coldx *= 256;             // Convert to units of 1/256 of a char
1383
+        $coldx *= 256; // Convert to units of 1/256 of a char
1384 1384
 
1385 1385
         $ixfe = $xfIndex;
1386
-        $reserved = 0x0000;            // Reserved
1386
+        $reserved = 0x0000; // Reserved
1387 1387
 
1388 1388
         $level = max(0, min($level, 7));
1389 1389
         $grbit |= $level << 8;
@@ -1424,20 +1424,20 @@  discard block
 block discarded – undo
1424 1424
         $rwFirst = min($rwFirst, 65535);
1425 1425
         $rwLast = min($rwLast, 65535);
1426 1426
 
1427
-        $record = 0x001D;                  // Record identifier
1428
-        $length = 0x000F;                  // Number of bytes to follow
1427
+        $record = 0x001D; // Record identifier
1428
+        $length = 0x000F; // Number of bytes to follow
1429 1429
 
1430
-        $pnn = $this->activePane;     // Pane position
1431
-        $rwAct = $rwFirst;                // Active row
1432
-        $colAct = $colFirst;               // Active column
1433
-        $irefAct = 0;                       // Active cell ref
1434
-        $cref = 1;                       // Number of refs
1430
+        $pnn = $this->activePane; // Pane position
1431
+        $rwAct = $rwFirst; // Active row
1432
+        $colAct = $colFirst; // Active column
1433
+        $irefAct = 0; // Active cell ref
1434
+        $cref = 1; // Number of refs
1435 1435
 
1436 1436
         if (!isset($rwLast)) {
1437
-            $rwLast = $rwFirst;       // Last  row in reference
1437
+            $rwLast = $rwFirst; // Last  row in reference
1438 1438
         }
1439 1439
         if (!isset($colLast)) {
1440
-            $colLast = $colFirst;      // Last  col in reference
1440
+            $colLast = $colFirst; // Last  col in reference
1441 1441
         }
1442 1442
 
1443 1443
         // Swap last row/col for first row/col as necessary
@@ -1621,7 +1621,7 @@  discard block
 block discarded – undo
1621 1621
 
1622 1622
             $length = strlen($recordData);
1623 1623
 
1624
-            $record = 0x0868;        // Record identifier
1624
+            $record = 0x0868; // Record identifier
1625 1625
             $header = pack('vv', $record, $length);
1626 1626
             $this->append($header . $recordData);
1627 1627
         }
@@ -1641,8 +1641,8 @@  discard block
 block discarded – undo
1641 1641
      */
1642 1642
     private function writeExterncount($count)
1643 1643
     {
1644
-        $record = 0x0016;          // Record identifier
1645
-        $length = 0x0002;          // Number of bytes to follow
1644
+        $record = 0x0016; // Record identifier
1645
+        $length = 0x0002; // Number of bytes to follow
1646 1646
 
1647 1647
         $header = pack('vv', $record, $length);
1648 1648
         $data = pack('v', $count);
@@ -1659,20 +1659,20 @@  discard block
 block discarded – undo
1659 1659
      */
1660 1660
     private function writeExternsheet($sheetname)
1661 1661
     {
1662
-        $record = 0x0017;         // Record identifier
1662
+        $record = 0x0017; // Record identifier
1663 1663
 
1664 1664
         // References to the current sheet are encoded differently to references to
1665 1665
         // external sheets.
1666 1666
         //
1667 1667
         if ($this->phpSheet->getTitle() == $sheetname) {
1668 1668
             $sheetname = '';
1669
-            $length = 0x02;  // The following 2 bytes
1670
-            $cch = 1;     // The following byte
1671
-            $rgch = 0x02;  // Self reference
1669
+            $length = 0x02; // The following 2 bytes
1670
+            $cch = 1; // The following byte
1671
+            $rgch = 0x02; // Self reference
1672 1672
         } else {
1673 1673
             $length = 0x02 + strlen($sheetname);
1674 1674
             $cch = strlen($sheetname);
1675
-            $rgch = 0x03;  // Reference to a sheet in the current workbook
1675
+            $rgch = 0x03; // Reference to a sheet in the current workbook
1676 1676
         }
1677 1677
 
1678 1678
         $header = pack('vv', $record, $length);
@@ -1707,8 +1707,8 @@  discard block
 block discarded – undo
1707 1707
         } else {
1708 1708
             $pnnAct = null;
1709 1709
         }
1710
-        $record = 0x0041;       // Record identifier
1711
-        $length = 0x000A;       // Number of bytes to follow
1710
+        $record = 0x0041; // Record identifier
1711
+        $length = 0x000A; // Number of bytes to follow
1712 1712
 
1713 1713
         // Code specific to frozen or thawed panes.
1714 1714
         if ($this->phpSheet->getFreezePane()) {
@@ -1767,38 +1767,38 @@  discard block
 block discarded – undo
1767 1767
      */
1768 1768
     private function writeSetup()
1769 1769
     {
1770
-        $record = 0x00A1;                  // Record identifier
1771
-        $length = 0x0022;                  // Number of bytes to follow
1770
+        $record = 0x00A1; // Record identifier
1771
+        $length = 0x0022; // Number of bytes to follow
1772 1772
 
1773
-        $iPaperSize = $this->phpSheet->getPageSetup()->getPaperSize();    // Paper size
1773
+        $iPaperSize = $this->phpSheet->getPageSetup()->getPaperSize(); // Paper size
1774 1774
 
1775 1775
         $iScale = $this->phpSheet->getPageSetup()->getScale() ?
1776
-            $this->phpSheet->getPageSetup()->getScale() : 100;   // Print scaling factor
1776
+            $this->phpSheet->getPageSetup()->getScale() : 100; // Print scaling factor
1777 1777
 
1778
-        $iPageStart = 0x01;                 // Starting page number
1779
-        $iFitWidth = (int) $this->phpSheet->getPageSetup()->getFitToWidth();    // Fit to number of pages wide
1780
-        $iFitHeight = (int) $this->phpSheet->getPageSetup()->getFitToHeight();    // Fit to number of pages high
1781
-        $grbit = 0x00;                 // Option flags
1782
-        $iRes = 0x0258;               // Print resolution
1783
-        $iVRes = 0x0258;               // Vertical print resolution
1778
+        $iPageStart = 0x01; // Starting page number
1779
+        $iFitWidth = (int) $this->phpSheet->getPageSetup()->getFitToWidth(); // Fit to number of pages wide
1780
+        $iFitHeight = (int) $this->phpSheet->getPageSetup()->getFitToHeight(); // Fit to number of pages high
1781
+        $grbit = 0x00; // Option flags
1782
+        $iRes = 0x0258; // Print resolution
1783
+        $iVRes = 0x0258; // Vertical print resolution
1784 1784
 
1785
-        $numHdr = $this->phpSheet->getPageMargins()->getHeader();  // Header Margin
1785
+        $numHdr = $this->phpSheet->getPageMargins()->getHeader(); // Header Margin
1786 1786
 
1787
-        $numFtr = $this->phpSheet->getPageMargins()->getFooter();   // Footer Margin
1788
-        $iCopies = 0x01;                 // Number of copies
1787
+        $numFtr = $this->phpSheet->getPageMargins()->getFooter(); // Footer Margin
1788
+        $iCopies = 0x01; // Number of copies
1789 1789
 
1790
-        $fLeftToRight = 0x0;                     // Print over then down
1790
+        $fLeftToRight = 0x0; // Print over then down
1791 1791
 
1792 1792
         // Page orientation
1793 1793
         $fLandscape = ($this->phpSheet->getPageSetup()->getOrientation() == \PhpSpreadsheet\Worksheet\PageSetup::ORIENTATION_LANDSCAPE) ?
1794 1794
             0x0 : 0x1;
1795 1795
 
1796
-        $fNoPls = 0x0;                     // Setup not read from printer
1797
-        $fNoColor = 0x0;                     // Print black and white
1798
-        $fDraft = 0x0;                     // Print draft quality
1799
-        $fNotes = 0x0;                     // Print notes
1800
-        $fNoOrient = 0x0;                     // Orientation not set
1801
-        $fUsePage = 0x0;                     // Use custom starting page
1796
+        $fNoPls = 0x0; // Setup not read from printer
1797
+        $fNoColor = 0x0; // Print black and white
1798
+        $fDraft = 0x0; // Print draft quality
1799
+        $fNotes = 0x0; // Print notes
1800
+        $fNoOrient = 0x0; // Orientation not set
1801
+        $fUsePage = 0x0; // Use custom starting page
1802 1802
 
1803 1803
         $grbit = $fLeftToRight;
1804 1804
         $grbit |= $fLandscape << 1;
@@ -1828,7 +1828,7 @@  discard block
 block discarded – undo
1828 1828
      */
1829 1829
     private function writeHeader()
1830 1830
     {
1831
-        $record = 0x0014;               // Record identifier
1831
+        $record = 0x0014; // Record identifier
1832 1832
 
1833 1833
         /* removing for now
1834 1834
         // need to fix character count (multibyte!)
@@ -1852,7 +1852,7 @@  discard block
 block discarded – undo
1852 1852
      */
1853 1853
     private function writeFooter()
1854 1854
     {
1855
-        $record = 0x0015;               // Record identifier
1855
+        $record = 0x0015; // Record identifier
1856 1856
 
1857 1857
         /* removing for now
1858 1858
         // need to fix character count (multibyte!)
@@ -1876,10 +1876,10 @@  discard block
 block discarded – undo
1876 1876
      */
1877 1877
     private function writeHcenter()
1878 1878
     {
1879
-        $record = 0x0083;              // Record identifier
1880
-        $length = 0x0002;              // Bytes to follow
1879
+        $record = 0x0083; // Record identifier
1880
+        $length = 0x0002; // Bytes to follow
1881 1881
 
1882
-        $fHCenter = $this->phpSheet->getPageSetup()->getHorizontalCentered() ? 1 : 0;     // Horizontal centering
1882
+        $fHCenter = $this->phpSheet->getPageSetup()->getHorizontalCentered() ? 1 : 0; // Horizontal centering
1883 1883
 
1884 1884
         $header = pack('vv', $record, $length);
1885 1885
         $data = pack('v', $fHCenter);
@@ -1892,10 +1892,10 @@  discard block
 block discarded – undo
1892 1892
      */
1893 1893
     private function writeVcenter()
1894 1894
     {
1895
-        $record = 0x0084;              // Record identifier
1896
-        $length = 0x0002;              // Bytes to follow
1895
+        $record = 0x0084; // Record identifier
1896
+        $length = 0x0002; // Bytes to follow
1897 1897
 
1898
-        $fVCenter = $this->phpSheet->getPageSetup()->getVerticalCentered() ? 1 : 0;     // Horizontal centering
1898
+        $fVCenter = $this->phpSheet->getPageSetup()->getVerticalCentered() ? 1 : 0; // Horizontal centering
1899 1899
 
1900 1900
         $header = pack('vv', $record, $length);
1901 1901
         $data = pack('v', $fVCenter);
@@ -1907,10 +1907,10 @@  discard block
 block discarded – undo
1907 1907
      */
1908 1908
     private function writeMarginLeft()
1909 1909
     {
1910
-        $record = 0x0026;                   // Record identifier
1911
-        $length = 0x0008;                   // Bytes to follow
1910
+        $record = 0x0026; // Record identifier
1911
+        $length = 0x0008; // Bytes to follow
1912 1912
 
1913
-        $margin = $this->phpSheet->getPageMargins()->getLeft();     // Margin in inches
1913
+        $margin = $this->phpSheet->getPageMargins()->getLeft(); // Margin in inches
1914 1914
 
1915 1915
         $header = pack('vv', $record, $length);
1916 1916
         $data = pack('d', $margin);
@@ -1926,10 +1926,10 @@  discard block
 block discarded – undo
1926 1926
      */
1927 1927
     private function writeMarginRight()
1928 1928
     {
1929
-        $record = 0x0027;                   // Record identifier
1930
-        $length = 0x0008;                   // Bytes to follow
1929
+        $record = 0x0027; // Record identifier
1930
+        $length = 0x0008; // Bytes to follow
1931 1931
 
1932
-        $margin = $this->phpSheet->getPageMargins()->getRight();     // Margin in inches
1932
+        $margin = $this->phpSheet->getPageMargins()->getRight(); // Margin in inches
1933 1933
 
1934 1934
         $header = pack('vv', $record, $length);
1935 1935
         $data = pack('d', $margin);
@@ -1945,10 +1945,10 @@  discard block
 block discarded – undo
1945 1945
      */
1946 1946
     private function writeMarginTop()
1947 1947
     {
1948
-        $record = 0x0028;                   // Record identifier
1949
-        $length = 0x0008;                   // Bytes to follow
1948
+        $record = 0x0028; // Record identifier
1949
+        $length = 0x0008; // Bytes to follow
1950 1950
 
1951
-        $margin = $this->phpSheet->getPageMargins()->getTop();     // Margin in inches
1951
+        $margin = $this->phpSheet->getPageMargins()->getTop(); // Margin in inches
1952 1952
 
1953 1953
         $header = pack('vv', $record, $length);
1954 1954
         $data = pack('d', $margin);
@@ -1964,10 +1964,10 @@  discard block
 block discarded – undo
1964 1964
      */
1965 1965
     private function writeMarginBottom()
1966 1966
     {
1967
-        $record = 0x0029;                   // Record identifier
1968
-        $length = 0x0008;                   // Bytes to follow
1967
+        $record = 0x0029; // Record identifier
1968
+        $length = 0x0008; // Bytes to follow
1969 1969
 
1970
-        $margin = $this->phpSheet->getPageMargins()->getBottom();     // Margin in inches
1970
+        $margin = $this->phpSheet->getPageMargins()->getBottom(); // Margin in inches
1971 1971
 
1972 1972
         $header = pack('vv', $record, $length);
1973 1973
         $data = pack('d', $margin);
@@ -1983,10 +1983,10 @@  discard block
 block discarded – undo
1983 1983
      */
1984 1984
     private function writePrintHeaders()
1985 1985
     {
1986
-        $record = 0x002a;                   // Record identifier
1987
-        $length = 0x0002;                   // Bytes to follow
1986
+        $record = 0x002a; // Record identifier
1987
+        $length = 0x0002; // Bytes to follow
1988 1988
 
1989
-        $fPrintRwCol = $this->_print_headers;     // Boolean flag
1989
+        $fPrintRwCol = $this->_print_headers; // Boolean flag
1990 1990
 
1991 1991
         $header = pack('vv', $record, $length);
1992 1992
         $data = pack('v', $fPrintRwCol);
@@ -1999,10 +1999,10 @@  discard block
 block discarded – undo
1999 1999
      */
2000 2000
     private function writePrintGridlines()
2001 2001
     {
2002
-        $record = 0x002b;                    // Record identifier
2003
-        $length = 0x0002;                    // Bytes to follow
2002
+        $record = 0x002b; // Record identifier
2003
+        $length = 0x0002; // Bytes to follow
2004 2004
 
2005
-        $fPrintGrid = $this->phpSheet->getPrintGridlines() ? 1 : 0;    // Boolean flag
2005
+        $fPrintGrid = $this->phpSheet->getPrintGridlines() ? 1 : 0; // Boolean flag
2006 2006
 
2007 2007
         $header = pack('vv', $record, $length);
2008 2008
         $data = pack('v', $fPrintGrid);
@@ -2015,10 +2015,10 @@  discard block
 block discarded – undo
2015 2015
      */
2016 2016
     private function writeGridset()
2017 2017
     {
2018
-        $record = 0x0082;                        // Record identifier
2019
-        $length = 0x0002;                        // Bytes to follow
2018
+        $record = 0x0082; // Record identifier
2019
+        $length = 0x0002; // Bytes to follow
2020 2020
 
2021
-        $fGridSet = !$this->phpSheet->getPrintGridlines();     // Boolean flag
2021
+        $fGridSet = !$this->phpSheet->getPrintGridlines(); // Boolean flag
2022 2022
 
2023 2023
         $header = pack('vv', $record, $length);
2024 2024
         $data = pack('v', $fGridSet);
@@ -2030,8 +2030,8 @@  discard block
 block discarded – undo
2030 2030
      */
2031 2031
     private function writeAutoFilterInfo()
2032 2032
     {
2033
-        $record = 0x009D;                        // Record identifier
2034
-        $length = 0x0002;                        // Bytes to follow
2033
+        $record = 0x009D; // Record identifier
2034
+        $length = 0x0002; // Bytes to follow
2035 2035
 
2036 2036
         $rangeBounds = \PhpSpreadsheet\Cell::rangeBoundaries($this->phpSheet->getAutoFilter()->getRange());
2037 2037
         $iNumFilters = 1 + $rangeBounds[1][0] - $rangeBounds[0][0];
@@ -2050,11 +2050,11 @@  discard block
 block discarded – undo
2050 2050
      */
2051 2051
     private function writeGuts()
2052 2052
     {
2053
-        $record = 0x0080;   // Record identifier
2054
-        $length = 0x0008;   // Bytes to follow
2053
+        $record = 0x0080; // Record identifier
2054
+        $length = 0x0008; // Bytes to follow
2055 2055
 
2056
-        $dxRwGut = 0x0000;   // Size of row gutter
2057
-        $dxColGut = 0x0000;   // Size of col gutter
2056
+        $dxRwGut = 0x0000; // Size of row gutter
2057
+        $dxColGut = 0x0000; // Size of col gutter
2058 2058
 
2059 2059
         // determine maximum row outline level
2060 2060
         $maxRowOutlineLevel = 0;
@@ -2094,15 +2094,15 @@  discard block
 block discarded – undo
2094 2094
      */
2095 2095
     private function writeWsbool()
2096 2096
     {
2097
-        $record = 0x0081;   // Record identifier
2098
-        $length = 0x0002;   // Bytes to follow
2097
+        $record = 0x0081; // Record identifier
2098
+        $length = 0x0002; // Bytes to follow
2099 2099
         $grbit = 0x0000;
2100 2100
 
2101 2101
         // The only option that is of interest is the flag for fit to page. So we
2102 2102
         // set all the options in one go.
2103 2103
         //
2104 2104
         // Set the option flags
2105
-        $grbit |= 0x0001;                           // Auto page breaks visible
2105
+        $grbit |= 0x0001; // Auto page breaks visible
2106 2106
         if ($this->outlineStyle) {
2107 2107
             $grbit |= 0x0020; // Auto outline styles
2108 2108
         }
@@ -2162,9 +2162,9 @@  discard block
 block discarded – undo
2162 2162
                 array_shift($hbreaks);
2163 2163
             }
2164 2164
 
2165
-            $record = 0x001b;               // Record identifier
2166
-            $cbrk = count($hbreaks);       // Number of page breaks
2167
-            $length = 2 + 6 * $cbrk;      // Bytes to follow
2165
+            $record = 0x001b; // Record identifier
2166
+            $cbrk = count($hbreaks); // Number of page breaks
2167
+            $length = 2 + 6 * $cbrk; // Bytes to follow
2168 2168
 
2169 2169
             $header = pack('vv', $record, $length);
2170 2170
             $data = pack('v', $cbrk);
@@ -2189,9 +2189,9 @@  discard block
 block discarded – undo
2189 2189
                 array_shift($vbreaks);
2190 2190
             }
2191 2191
 
2192
-            $record = 0x001a;               // Record identifier
2193
-            $cbrk = count($vbreaks);       // Number of page breaks
2194
-            $length = 2 + 6 * $cbrk;      // Bytes to follow
2192
+            $record = 0x001a; // Record identifier
2193
+            $cbrk = count($vbreaks); // Number of page breaks
2194
+            $length = 2 + 6 * $cbrk; // Bytes to follow
2195 2195
 
2196 2196
             $header = pack('vv', $record, $length);
2197 2197
             $data = pack('v', $cbrk);
@@ -2215,10 +2215,10 @@  discard block
 block discarded – undo
2215 2215
             return;
2216 2216
         }
2217 2217
 
2218
-        $record = 0x0012;             // Record identifier
2219
-        $length = 0x0002;             // Bytes to follow
2218
+        $record = 0x0012; // Record identifier
2219
+        $length = 0x0002; // Bytes to follow
2220 2220
 
2221
-        $fLock = 1;    // Worksheet is protected
2221
+        $fLock = 1; // Worksheet is protected
2222 2222
 
2223 2223
         $header = pack('vv', $record, $length);
2224 2224
         $data = pack('v', $fLock);
@@ -2284,10 +2284,10 @@  discard block
 block discarded – undo
2284 2284
             return;
2285 2285
         }
2286 2286
 
2287
-        $record = 0x0013;               // Record identifier
2288
-        $length = 0x0002;               // Bytes to follow
2287
+        $record = 0x0013; // Record identifier
2288
+        $length = 0x0002; // Bytes to follow
2289 2289
 
2290
-        $wPassword = hexdec($this->phpSheet->getProtection()->getPassword());     // Encoded password
2290
+        $wPassword = hexdec($this->phpSheet->getProtection()->getPassword()); // Encoded password
2291 2291
 
2292 2292
         $header = pack('vv', $record, $length);
2293 2293
         $data = pack('v', $wPassword);
@@ -2382,8 +2382,8 @@  discard block
 block discarded – undo
2382 2382
     public function positionImage($col_start, $row_start, $x1, $y1, $width, $height)
2383 2383
     {
2384 2384
         // Initialise end cell to the same as the start cell
2385
-        $col_end = $col_start;  // Col containing lower right corner of object
2386
-        $row_end = $row_start;  // Row containing bottom right corner of object
2385
+        $col_end = $col_start; // Col containing lower right corner of object
2386
+        $row_end = $row_start; // Row containing bottom right corner of object
2387 2387
 
2388 2388
         // Zero the specified offset if greater than the cell dimensions
2389 2389
         if ($x1 >= \PhpSpreadsheet\Shared\Excel5::sizeCol($this->phpSheet, \PhpSpreadsheet\Cell::stringFromColumnIndex($col_start))) {
@@ -2448,33 +2448,33 @@  discard block
 block discarded – undo
2448 2448
      */
2449 2449
     private function writeObjPicture($colL, $dxL, $rwT, $dyT, $colR, $dxR, $rwB, $dyB)
2450 2450
     {
2451
-        $record = 0x005d;   // Record identifier
2452
-        $length = 0x003c;   // Bytes to follow
2453
-
2454
-        $cObj = 0x0001;   // Count of objects in file (set to 1)
2455
-        $OT = 0x0008;   // Object type. 8 = Picture
2456
-        $id = 0x0001;   // Object ID
2457
-        $grbit = 0x0614;   // Option flags
2458
-
2459
-        $cbMacro = 0x0000;   // Length of FMLA structure
2460
-        $Reserved1 = 0x0000;   // Reserved
2461
-        $Reserved2 = 0x0000;   // Reserved
2462
-
2463
-        $icvBack = 0x09;     // Background colour
2464
-        $icvFore = 0x09;     // Foreground colour
2465
-        $fls = 0x00;     // Fill pattern
2466
-        $fAuto = 0x00;     // Automatic fill
2467
-        $icv = 0x08;     // Line colour
2468
-        $lns = 0xff;     // Line style
2469
-        $lnw = 0x01;     // Line weight
2470
-        $fAutoB = 0x00;     // Automatic border
2471
-        $frs = 0x0000;   // Frame style
2472
-        $cf = 0x0009;   // Image format, 9 = bitmap
2473
-        $Reserved3 = 0x0000;   // Reserved
2474
-        $cbPictFmla = 0x0000;   // Length of FMLA structure
2475
-        $Reserved4 = 0x0000;   // Reserved
2476
-        $grbit2 = 0x0001;   // Option flags
2477
-        $Reserved5 = 0x0000;   // Reserved
2451
+        $record = 0x005d; // Record identifier
2452
+        $length = 0x003c; // Bytes to follow
2453
+
2454
+        $cObj = 0x0001; // Count of objects in file (set to 1)
2455
+        $OT = 0x0008; // Object type. 8 = Picture
2456
+        $id = 0x0001; // Object ID
2457
+        $grbit = 0x0614; // Option flags
2458
+
2459
+        $cbMacro = 0x0000; // Length of FMLA structure
2460
+        $Reserved1 = 0x0000; // Reserved
2461
+        $Reserved2 = 0x0000; // Reserved
2462
+
2463
+        $icvBack = 0x09; // Background colour
2464
+        $icvFore = 0x09; // Foreground colour
2465
+        $fls = 0x00; // Fill pattern
2466
+        $fAuto = 0x00; // Automatic fill
2467
+        $icv = 0x08; // Line colour
2468
+        $lns = 0xff; // Line style
2469
+        $lnw = 0x01; // Line weight
2470
+        $fAutoB = 0x00; // Automatic border
2471
+        $frs = 0x0000; // Frame style
2472
+        $cf = 0x0009; // Image format, 9 = bitmap
2473
+        $Reserved3 = 0x0000; // Reserved
2474
+        $cbPictFmla = 0x0000; // Length of FMLA structure
2475
+        $Reserved4 = 0x0000; // Reserved
2476
+        $grbit2 = 0x0001; // Option flags
2477
+        $Reserved5 = 0x0000; // Reserved
2478 2478
 
2479 2479
         $header = pack('vv', $record, $length);
2480 2480
         $data = pack('V', $cObj);
@@ -2636,8 +2636,8 @@  discard block
 block discarded – undo
2636 2636
             return;
2637 2637
         }
2638 2638
 
2639
-        $record = 0x00A0;               // Record identifier
2640
-        $length = 0x0004;               // Bytes to follow
2639
+        $record = 0x00A0; // Record identifier
2640
+        $length = 0x0004; // Bytes to follow
2641 2641
 
2642 2642
         $header = pack('vv', $record, $length);
2643 2643
         $data = pack('vv', $this->phpSheet->getSheetView()->getZoomScale(), 100);
@@ -2682,7 +2682,7 @@  discard block
 block discarded – undo
2682 2682
             $nm = count($spOffsets) - 1; // number of shapes excluding first shape
2683 2683
             for ($i = 1; $i <= $nm; ++$i) {
2684 2684
                 // MSODRAWING record
2685
-                $record = 0x00EC;            // Record identifier
2685
+                $record = 0x00EC; // Record identifier
2686 2686
 
2687 2687
                 // chunk of Escher stream for one shape
2688 2688
                 $dataChunk = substr($data, $spOffsets[$i - 1], $spOffsets[$i] - $spOffsets[$i - 1]);
@@ -2760,20 +2760,20 @@  discard block
 block discarded – undo
2760 2760
         // Write data validations?
2761 2761
         if (!empty($dataValidationCollection)) {
2762 2762
             // DATAVALIDATIONS record
2763
-            $record = 0x01B2;      // Record identifier
2764
-            $length = 0x0012;      // Bytes to follow
2763
+            $record = 0x01B2; // Record identifier
2764
+            $length = 0x0012; // Bytes to follow
2765 2765
 
2766
-            $grbit = 0x0000;       // Prompt box at cell, no cached validity data at DV records
2767
-            $horPos = 0x00000000;  // Horizontal position of prompt box, if fixed position
2768
-            $verPos = 0x00000000;  // Vertical position of prompt box, if fixed position
2769
-            $objId = 0xFFFFFFFF;  // Object identifier of drop down arrow object, or -1 if not visible
2766
+            $grbit = 0x0000; // Prompt box at cell, no cached validity data at DV records
2767
+            $horPos = 0x00000000; // Horizontal position of prompt box, if fixed position
2768
+            $verPos = 0x00000000; // Vertical position of prompt box, if fixed position
2769
+            $objId = 0xFFFFFFFF; // Object identifier of drop down arrow object, or -1 if not visible
2770 2770
 
2771 2771
             $header = pack('vv', $record, $length);
2772 2772
             $data = pack('vVVVV', $grbit, $horPos, $verPos, $objId, count($dataValidationCollection));
2773 2773
             $this->append($header . $data);
2774 2774
 
2775 2775
             // DATAVALIDATION records
2776
-            $record = 0x01BE;              // Record identifier
2776
+            $record = 0x01BE; // Record identifier
2777 2777
 
2778 2778
             foreach ($dataValidationCollection as $cellCoordinate => $dataValidation) {
2779 2779
                 // initialize record data
@@ -2973,8 +2973,8 @@  discard block
 block discarded – undo
2973 2973
      */
2974 2974
     private function writePageLayoutView()
2975 2975
     {
2976
-        $record = 0x088B;               // Record identifier
2977
-        $length = 0x0010;               // Bytes to follow
2976
+        $record = 0x088B; // Record identifier
2977
+        $length = 0x0010; // Bytes to follow
2978 2978
 
2979 2979
         $rt = 0x088B; // 2
2980 2980
         $grbitFrt = 0x0000; // 2
@@ -3005,7 +3005,7 @@  discard block
 block discarded – undo
3005 3005
      */
3006 3006
     private function writeCFRule(\PhpSpreadsheet\Style\Conditional $conditional)
3007 3007
     {
3008
-        $record = 0x01B1;               // Record identifier
3008
+        $record = 0x01B1; // Record identifier
3009 3009
 
3010 3010
         // $type : Type of the CF
3011 3011
         // $operatorType : Comparison operator
@@ -3125,43 +3125,43 @@  discard block
 block discarded – undo
3125 3125
         }
3126 3126
         // Alignment
3127 3127
         $flags = 0;
3128
-        $flags |= (1 == $bAlignHz      ? 0x00000001 : 0);
3129
-        $flags |= (1 == $bAlignVt      ? 0x00000002 : 0);
3130
-        $flags |= (1 == $bAlignWrapTx  ? 0x00000004 : 0);
3131
-        $flags |= (1 == $bTxRotation   ? 0x00000008 : 0);
3128
+        $flags |= (1 == $bAlignHz ? 0x00000001 : 0);
3129
+        $flags |= (1 == $bAlignVt ? 0x00000002 : 0);
3130
+        $flags |= (1 == $bAlignWrapTx ? 0x00000004 : 0);
3131
+        $flags |= (1 == $bTxRotation ? 0x00000008 : 0);
3132 3132
         // Justify last line flag
3133
-        $flags |= (1 == 1              ? 0x00000010 : 0);
3134
-        $flags |= (1 == $bIndent       ? 0x00000020 : 0);
3135
-        $flags |= (1 == $bShrinkToFit  ? 0x00000040 : 0);
3133
+        $flags |= (1 == 1 ? 0x00000010 : 0);
3134
+        $flags |= (1 == $bIndent ? 0x00000020 : 0);
3135
+        $flags |= (1 == $bShrinkToFit ? 0x00000040 : 0);
3136 3136
         // Default
3137
-        $flags |= (1 == 1              ? 0x00000080 : 0);
3137
+        $flags |= (1 == 1 ? 0x00000080 : 0);
3138 3138
         // Protection
3139
-        $flags |= (1 == $bProtLocked   ? 0x00000100 : 0);
3140
-        $flags |= (1 == $bProtHidden   ? 0x00000200 : 0);
3139
+        $flags |= (1 == $bProtLocked ? 0x00000100 : 0);
3140
+        $flags |= (1 == $bProtHidden ? 0x00000200 : 0);
3141 3141
         // Border
3142
-        $flags |= (1 == $bBorderLeft   ? 0x00000400 : 0);
3143
-        $flags |= (1 == $bBorderRight  ? 0x00000800 : 0);
3144
-        $flags |= (1 == $bBorderTop    ? 0x00001000 : 0);
3142
+        $flags |= (1 == $bBorderLeft ? 0x00000400 : 0);
3143
+        $flags |= (1 == $bBorderRight ? 0x00000800 : 0);
3144
+        $flags |= (1 == $bBorderTop ? 0x00001000 : 0);
3145 3145
         $flags |= (1 == $bBorderBottom ? 0x00002000 : 0);
3146
-        $flags |= (1 == 1              ? 0x00004000 : 0); // Top left to Bottom right border
3147
-        $flags |= (1 == 1              ? 0x00008000 : 0); // Bottom left to Top right border
3146
+        $flags |= (1 == 1 ? 0x00004000 : 0); // Top left to Bottom right border
3147
+        $flags |= (1 == 1 ? 0x00008000 : 0); // Bottom left to Top right border
3148 3148
         // Pattern
3149
-        $flags |= (1 == $bFillStyle    ? 0x00010000 : 0);
3150
-        $flags |= (1 == $bFillColor    ? 0x00020000 : 0);
3151
-        $flags |= (1 == $bFillColorBg  ? 0x00040000 : 0);
3152
-        $flags |= (1 == 1              ? 0x00380000 : 0);
3149
+        $flags |= (1 == $bFillStyle ? 0x00010000 : 0);
3150
+        $flags |= (1 == $bFillColor ? 0x00020000 : 0);
3151
+        $flags |= (1 == $bFillColorBg ? 0x00040000 : 0);
3152
+        $flags |= (1 == 1 ? 0x00380000 : 0);
3153 3153
         // Font
3154
-        $flags |= (1 == $bFormatFont   ? 0x04000000 : 0);
3154
+        $flags |= (1 == $bFormatFont ? 0x04000000 : 0);
3155 3155
         // Alignment:
3156
-        $flags |= (1 == $bFormatAlign  ? 0x08000000 : 0);
3156
+        $flags |= (1 == $bFormatAlign ? 0x08000000 : 0);
3157 3157
         // Border
3158 3158
         $flags |= (1 == $bFormatBorder ? 0x10000000 : 0);
3159 3159
         // Pattern
3160
-        $flags |= (1 == $bFormatFill   ? 0x20000000 : 0);
3160
+        $flags |= (1 == $bFormatFill ? 0x20000000 : 0);
3161 3161
         // Protection
3162
-        $flags |= (1 == $bFormatProt   ? 0x40000000 : 0);
3162
+        $flags |= (1 == $bFormatProt ? 0x40000000 : 0);
3163 3163
         // Text direction
3164
-        $flags |= (1 == 0              ? 0x80000000 : 0);
3164
+        $flags |= (1 == 0 ? 0x80000000 : 0);
3165 3165
 
3166 3166
         // Data Blocks
3167 3167
         if ($bFormatFont == 1) {
@@ -3406,11 +3406,11 @@  discard block
 block discarded – undo
3406 3406
             // Options flags for modified font attributes
3407 3407
             $optionsFlags = 0;
3408 3408
             $optionsFlagsBold = ($conditional->getStyle()->getFont()->getBold() == null ? 1 : 0);
3409
-            $optionsFlags |= (1 == $optionsFlagsBold  ? 0x00000002 : 0);
3410
-            $optionsFlags |= (1 == 1                  ? 0x00000008 : 0);
3411
-            $optionsFlags |= (1 == 1                  ? 0x00000010 : 0);
3412
-            $optionsFlags |= (1 == 0                  ? 0x00000020 : 0);
3413
-            $optionsFlags |= (1 == 1                  ? 0x00000080 : 0);
3409
+            $optionsFlags |= (1 == $optionsFlagsBold ? 0x00000002 : 0);
3410
+            $optionsFlags |= (1 == 1 ? 0x00000008 : 0);
3411
+            $optionsFlags |= (1 == 1 ? 0x00000010 : 0);
3412
+            $optionsFlags |= (1 == 0 ? 0x00000020 : 0);
3413
+            $optionsFlags |= (1 == 1 ? 0x00000080 : 0);
3414 3414
             $dataBlockFont .= pack('V', $optionsFlags);
3415 3415
             // Escapement type
3416 3416
             $dataBlockFont .= pack('V', $fontEscapement);
@@ -3781,10 +3781,10 @@  discard block
 block discarded – undo
3781 3781
                     break;
3782 3782
                 case \PhpSpreadsheet\Style\Fill::FILL_GRADIENT_LINEAR:
3783 3783
                     $blockFillPatternStyle = 0x00;
3784
-                    break;    // does not exist in BIFF8
3784
+                    break; // does not exist in BIFF8
3785 3785
                 case \PhpSpreadsheet\Style\Fill::FILL_GRADIENT_PATH:
3786 3786
                     $blockFillPatternStyle = 0x00;
3787
-                    break;    // does not exist in BIFF8
3787
+                    break; // does not exist in BIFF8
3788 3788
                 default:
3789 3789
                     $blockFillPatternStyle = 0x00;
3790 3790
                     break;
@@ -4181,8 +4181,8 @@  discard block
 block discarded – undo
4181 4181
      */
4182 4182
     private function writeCFHeader()
4183 4183
     {
4184
-        $record = 0x01B0;               // Record identifier
4185
-        $length = 0x0016;               // Bytes to follow
4184
+        $record = 0x01B0; // Record identifier
4185
+        $length = 0x0016; // Bytes to follow
4186 4186
 
4187 4187
         $numColumnMin = null;
4188 4188
         $numColumnMax = null;
Please login to merge, or discard this patch.
src/PhpSpreadsheet/Writer/Excel5/Parser.php 2 patches
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -666,7 +666,7 @@
 block discarded – undo
666 666
             list($row1, $col1) = $this->cellToPackedRowcol($cell1);
667 667
             list($row2, $col2) = $this->cellToPackedRowcol($cell2);
668 668
         } else { // It's a rows range (like 26:27)
669
-             list($row1, $col1, $row2, $col2) = $this->rangeToPackedRange($cell1 . ':' . $cell2);
669
+                list($row1, $col1, $row2, $col2) = $this->rangeToPackedRange($cell1 . ':' . $cell2);
670 670
         }
671 671
 
672 672
         // The ptg value depends on the class of the ptg.
Please login to merge, or discard this patch.
Spacing   +261 added lines, -261 removed lines patch added patch discarded remove patch
@@ -114,11 +114,11 @@  discard block
 block discarded – undo
114 114
     public function __construct()
115 115
     {
116 116
         $this->currentCharacter = 0;
117
-        $this->currentToken = '';       // The token we are working on.
118
-        $this->formula = '';       // The formula to parse.
119
-        $this->lookAhead = '';       // The character ahead of the current char.
120
-        $this->parseTree = '';       // The parse tree to be generated.
121
-        $this->initializeHashes();      // Initialize the hashes: ptg's and function's ptg's
117
+        $this->currentToken = ''; // The token we are working on.
118
+        $this->formula = ''; // The formula to parse.
119
+        $this->lookAhead = ''; // The character ahead of the current char.
120
+        $this->parseTree = ''; // The parse tree to be generated.
121
+        $this->initializeHashes(); // Initialize the hashes: ptg's and function's ptg's
122 122
         $this->externalSheets = [];
123 123
         $this->references = [];
124 124
     }
@@ -242,256 +242,256 @@  discard block
 block discarded – undo
242 242
         //
243 243
         $this->functions = [
244 244
             // function                  ptg  args  class  vol
245
-            'COUNT' => [0,   -1,    0,    0],
246
-            'IF' => [1,   -1,    1,    0],
247
-            'ISNA' => [2,    1,    1,    0],
248
-            'ISERROR' => [3,    1,    1,    0],
249
-            'SUM' => [4,   -1,    0,    0],
250
-            'AVERAGE' => [5,   -1,    0,    0],
251
-            'MIN' => [6,   -1,    0,    0],
252
-            'MAX' => [7,   -1,    0,    0],
253
-            'ROW' => [8,   -1,    0,    0],
254
-            'COLUMN' => [9,   -1,    0,    0],
255
-            'NA' => [10,    0,    0,    0],
256
-            'NPV' => [11,   -1,    1,    0],
257
-            'STDEV' => [12,   -1,    0,    0],
258
-            'DOLLAR' => [13,   -1,    1,    0],
259
-            'FIXED' => [14,   -1,    1,    0],
260
-            'SIN' => [15,    1,    1,    0],
261
-            'COS' => [16,    1,    1,    0],
262
-            'TAN' => [17,    1,    1,    0],
263
-            'ATAN' => [18,    1,    1,    0],
264
-            'PI' => [19,    0,    1,    0],
265
-            'SQRT' => [20,    1,    1,    0],
266
-            'EXP' => [21,    1,    1,    0],
267
-            'LN' => [22,    1,    1,    0],
268
-            'LOG10' => [23,    1,    1,    0],
269
-            'ABS' => [24,    1,    1,    0],
270
-            'INT' => [25,    1,    1,    0],
271
-            'SIGN' => [26,    1,    1,    0],
272
-            'ROUND' => [27,    2,    1,    0],
273
-            'LOOKUP' => [28,   -1,    0,    0],
274
-            'INDEX' => [29,   -1,    0,    1],
275
-            'REPT' => [30,    2,    1,    0],
276
-            'MID' => [31,    3,    1,    0],
277
-            'LEN' => [32,    1,    1,    0],
278
-            'VALUE' => [33,    1,    1,    0],
279
-            'TRUE' => [34,    0,    1,    0],
280
-            'FALSE' => [35,    0,    1,    0],
281
-            'AND' => [36,   -1,    0,    0],
282
-            'OR' => [37,   -1,    0,    0],
283
-            'NOT' => [38,    1,    1,    0],
284
-            'MOD' => [39,    2,    1,    0],
285
-            'DCOUNT' => [40,    3,    0,    0],
286
-            'DSUM' => [41,    3,    0,    0],
287
-            'DAVERAGE' => [42,    3,    0,    0],
288
-            'DMIN' => [43,    3,    0,    0],
289
-            'DMAX' => [44,    3,    0,    0],
290
-            'DSTDEV' => [45,    3,    0,    0],
291
-            'VAR' => [46,   -1,    0,    0],
292
-            'DVAR' => [47,    3,    0,    0],
293
-            'TEXT' => [48,    2,    1,    0],
294
-            'LINEST' => [49,   -1,    0,    0],
295
-            'TREND' => [50,   -1,    0,    0],
296
-            'LOGEST' => [51,   -1,    0,    0],
297
-            'GROWTH' => [52,   -1,    0,    0],
298
-            'PV' => [56,   -1,    1,    0],
299
-            'FV' => [57,   -1,    1,    0],
300
-            'NPER' => [58,   -1,    1,    0],
301
-            'PMT' => [59,   -1,    1,    0],
302
-            'RATE' => [60,   -1,    1,    0],
303
-            'MIRR' => [61,    3,    0,    0],
304
-            'IRR' => [62,   -1,    0,    0],
305
-            'RAND' => [63,    0,    1,    1],
306
-            'MATCH' => [64,   -1,    0,    0],
307
-            'DATE' => [65,    3,    1,    0],
308
-            'TIME' => [66,    3,    1,    0],
309
-            'DAY' => [67,    1,    1,    0],
310
-            'MONTH' => [68,    1,    1,    0],
311
-            'YEAR' => [69,    1,    1,    0],
312
-            'WEEKDAY' => [70,   -1,    1,    0],
313
-            'HOUR' => [71,    1,    1,    0],
314
-            'MINUTE' => [72,    1,    1,    0],
315
-            'SECOND' => [73,    1,    1,    0],
316
-            'NOW' => [74,    0,    1,    1],
317
-            'AREAS' => [75,    1,    0,    1],
318
-            'ROWS' => [76,    1,    0,    1],
319
-            'COLUMNS' => [77,    1,    0,    1],
320
-            'OFFSET' => [78,   -1,    0,    1],
321
-            'SEARCH' => [82,   -1,    1,    0],
322
-            'TRANSPOSE' => [83,    1,    1,    0],
323
-            'TYPE' => [86,    1,    1,    0],
324
-            'ATAN2' => [97,    2,    1,    0],
325
-            'ASIN' => [98,    1,    1,    0],
326
-            'ACOS' => [99,    1,    1,    0],
327
-            'CHOOSE' => [100,   -1,    1,    0],
328
-            'HLOOKUP' => [101,   -1,    0,    0],
329
-            'VLOOKUP' => [102,   -1,    0,    0],
330
-            'ISREF' => [105,    1,    0,    0],
331
-            'LOG' => [109,   -1,    1,    0],
332
-            'CHAR' => [111,    1,    1,    0],
333
-            'LOWER' => [112,    1,    1,    0],
334
-            'UPPER' => [113,    1,    1,    0],
335
-            'PROPER' => [114,    1,    1,    0],
336
-            'LEFT' => [115,   -1,    1,    0],
337
-            'RIGHT' => [116,   -1,    1,    0],
338
-            'EXACT' => [117,    2,    1,    0],
339
-            'TRIM' => [118,    1,    1,    0],
340
-            'REPLACE' => [119,    4,    1,    0],
341
-            'SUBSTITUTE' => [120,   -1,    1,    0],
342
-            'CODE' => [121,    1,    1,    0],
343
-            'FIND' => [124,   -1,    1,    0],
344
-            'CELL' => [125,   -1,    0,    1],
345
-            'ISERR' => [126,    1,    1,    0],
346
-            'ISTEXT' => [127,    1,    1,    0],
347
-            'ISNUMBER' => [128,    1,    1,    0],
348
-            'ISBLANK' => [129,    1,    1,    0],
349
-            'T' => [130,    1,    0,    0],
350
-            'N' => [131,    1,    0,    0],
351
-            'DATEVALUE' => [140,    1,    1,    0],
352
-            'TIMEVALUE' => [141,    1,    1,    0],
353
-            'SLN' => [142,    3,    1,    0],
354
-            'SYD' => [143,    4,    1,    0],
355
-            'DDB' => [144,   -1,    1,    0],
356
-            'INDIRECT' => [148,   -1,    1,    1],
357
-            'CALL' => [150,   -1,    1,    0],
358
-            'CLEAN' => [162,    1,    1,    0],
359
-            'MDETERM' => [163,    1,    2,    0],
360
-            'MINVERSE' => [164,    1,    2,    0],
361
-            'MMULT' => [165,    2,    2,    0],
362
-            'IPMT' => [167,   -1,    1,    0],
363
-            'PPMT' => [168,   -1,    1,    0],
364
-            'COUNTA' => [169,   -1,    0,    0],
365
-            'PRODUCT' => [183,   -1,    0,    0],
366
-            'FACT' => [184,    1,    1,    0],
367
-            'DPRODUCT' => [189,    3,    0,    0],
368
-            'ISNONTEXT' => [190,    1,    1,    0],
369
-            'STDEVP' => [193,   -1,    0,    0],
370
-            'VARP' => [194,   -1,    0,    0],
371
-            'DSTDEVP' => [195,    3,    0,    0],
372
-            'DVARP' => [196,    3,    0,    0],
373
-            'TRUNC' => [197,   -1,    1,    0],
374
-            'ISLOGICAL' => [198,    1,    1,    0],
375
-            'DCOUNTA' => [199,    3,    0,    0],
376
-            'USDOLLAR' => [204,   -1,    1,    0],
377
-            'FINDB' => [205,   -1,    1,    0],
378
-            'SEARCHB' => [206,   -1,    1,    0],
379
-            'REPLACEB' => [207,    4,    1,    0],
380
-            'LEFTB' => [208,   -1,    1,    0],
381
-            'RIGHTB' => [209,   -1,    1,    0],
382
-            'MIDB' => [210,    3,    1,    0],
383
-            'LENB' => [211,    1,    1,    0],
384
-            'ROUNDUP' => [212,    2,    1,    0],
385
-            'ROUNDDOWN' => [213,    2,    1,    0],
386
-            'ASC' => [214,    1,    1,    0],
387
-            'DBCS' => [215,    1,    1,    0],
388
-            'RANK' => [216,   -1,    0,    0],
389
-            'ADDRESS' => [219,   -1,    1,    0],
390
-            'DAYS360' => [220,   -1,    1,    0],
391
-            'TODAY' => [221,    0,    1,    1],
392
-            'VDB' => [222,   -1,    1,    0],
393
-            'MEDIAN' => [227,   -1,    0,    0],
394
-            'SUMPRODUCT' => [228,   -1,    2,    0],
395
-            'SINH' => [229,    1,    1,    0],
396
-            'COSH' => [230,    1,    1,    0],
397
-            'TANH' => [231,    1,    1,    0],
398
-            'ASINH' => [232,    1,    1,    0],
399
-            'ACOSH' => [233,    1,    1,    0],
400
-            'ATANH' => [234,    1,    1,    0],
401
-            'DGET' => [235,    3,    0,    0],
402
-            'INFO' => [244,    1,    1,    1],
403
-            'DB' => [247,   -1,    1,    0],
404
-            'FREQUENCY' => [252,    2,    0,    0],
405
-            'ERROR.TYPE' => [261,    1,    1,    0],
406
-            'REGISTER.ID' => [267,   -1,    1,    0],
407
-            'AVEDEV' => [269,   -1,    0,    0],
408
-            'BETADIST' => [270,   -1,    1,    0],
409
-            'GAMMALN' => [271,    1,    1,    0],
410
-            'BETAINV' => [272,   -1,    1,    0],
411
-            'BINOMDIST' => [273,    4,    1,    0],
412
-            'CHIDIST' => [274,    2,    1,    0],
413
-            'CHIINV' => [275,    2,    1,    0],
414
-            'COMBIN' => [276,    2,    1,    0],
415
-            'CONFIDENCE' => [277,    3,    1,    0],
416
-            'CRITBINOM' => [278,    3,    1,    0],
417
-            'EVEN' => [279,    1,    1,    0],
418
-            'EXPONDIST' => [280,    3,    1,    0],
419
-            'FDIST' => [281,    3,    1,    0],
420
-            'FINV' => [282,    3,    1,    0],
421
-            'FISHER' => [283,    1,    1,    0],
422
-            'FISHERINV' => [284,    1,    1,    0],
423
-            'FLOOR' => [285,    2,    1,    0],
424
-            'GAMMADIST' => [286,    4,    1,    0],
425
-            'GAMMAINV' => [287,    3,    1,    0],
426
-            'CEILING' => [288,    2,    1,    0],
427
-            'HYPGEOMDIST' => [289,    4,    1,    0],
428
-            'LOGNORMDIST' => [290,    3,    1,    0],
429
-            'LOGINV' => [291,    3,    1,    0],
430
-            'NEGBINOMDIST' => [292,    3,    1,    0],
431
-            'NORMDIST' => [293,    4,    1,    0],
432
-            'NORMSDIST' => [294,    1,    1,    0],
433
-            'NORMINV' => [295,    3,    1,    0],
434
-            'NORMSINV' => [296,    1,    1,    0],
435
-            'STANDARDIZE' => [297,    3,    1,    0],
436
-            'ODD' => [298,    1,    1,    0],
437
-            'PERMUT' => [299,    2,    1,    0],
438
-            'POISSON' => [300,    3,    1,    0],
439
-            'TDIST' => [301,    3,    1,    0],
440
-            'WEIBULL' => [302,    4,    1,    0],
441
-            'SUMXMY2' => [303,    2,    2,    0],
442
-            'SUMX2MY2' => [304,    2,    2,    0],
443
-            'SUMX2PY2' => [305,    2,    2,    0],
444
-            'CHITEST' => [306,    2,    2,    0],
445
-            'CORREL' => [307,    2,    2,    0],
446
-            'COVAR' => [308,    2,    2,    0],
447
-            'FORECAST' => [309,    3,    2,    0],
448
-            'FTEST' => [310,    2,    2,    0],
449
-            'INTERCEPT' => [311,    2,    2,    0],
450
-            'PEARSON' => [312,    2,    2,    0],
451
-            'RSQ' => [313,    2,    2,    0],
452
-            'STEYX' => [314,    2,    2,    0],
453
-            'SLOPE' => [315,    2,    2,    0],
454
-            'TTEST' => [316,    4,    2,    0],
455
-            'PROB' => [317,   -1,    2,    0],
456
-            'DEVSQ' => [318,   -1,    0,    0],
457
-            'GEOMEAN' => [319,   -1,    0,    0],
458
-            'HARMEAN' => [320,   -1,    0,    0],
459
-            'SUMSQ' => [321,   -1,    0,    0],
460
-            'KURT' => [322,   -1,    0,    0],
461
-            'SKEW' => [323,   -1,    0,    0],
462
-            'ZTEST' => [324,   -1,    0,    0],
463
-            'LARGE' => [325,    2,    0,    0],
464
-            'SMALL' => [326,    2,    0,    0],
465
-            'QUARTILE' => [327,    2,    0,    0],
466
-            'PERCENTILE' => [328,    2,    0,    0],
467
-            'PERCENTRANK' => [329,   -1,    0,    0],
468
-            'MODE' => [330,   -1,    2,    0],
469
-            'TRIMMEAN' => [331,    2,    0,    0],
470
-            'TINV' => [332,    2,    1,    0],
471
-            'CONCATENATE' => [336,   -1,    1,    0],
472
-            'POWER' => [337,    2,    1,    0],
473
-            'RADIANS' => [342,    1,    1,    0],
474
-            'DEGREES' => [343,    1,    1,    0],
475
-            'SUBTOTAL' => [344,   -1,    0,    0],
476
-            'SUMIF' => [345,   -1,    0,    0],
477
-            'COUNTIF' => [346,    2,    0,    0],
478
-            'COUNTBLANK' => [347,    1,    0,    0],
479
-            'ISPMT' => [350,    4,    1,    0],
480
-            'DATEDIF' => [351,    3,    1,    0],
481
-            'DATESTRING' => [352,    1,    1,    0],
482
-            'NUMBERSTRING' => [353,    2,    1,    0],
483
-            'ROMAN' => [354,   -1,    1,    0],
484
-            'GETPIVOTDATA' => [358,   -1,    0,    0],
485
-            'HYPERLINK' => [359,   -1,    1,    0],
486
-            'PHONETIC' => [360,    1,    0,    0],
487
-            'AVERAGEA' => [361,   -1,    0,    0],
488
-            'MAXA' => [362,   -1,    0,    0],
489
-            'MINA' => [363,   -1,    0,    0],
490
-            'STDEVPA' => [364,   -1,    0,    0],
491
-            'VARPA' => [365,   -1,    0,    0],
492
-            'STDEVA' => [366,   -1,    0,    0],
493
-            'VARA' => [367,   -1,    0,    0],
494
-            'BAHTTEXT' => [368,    1,    0,    0],
245
+            'COUNT' => [0, -1, 0, 0],
246
+            'IF' => [1, -1, 1, 0],
247
+            'ISNA' => [2, 1, 1, 0],
248
+            'ISERROR' => [3, 1, 1, 0],
249
+            'SUM' => [4, -1, 0, 0],
250
+            'AVERAGE' => [5, -1, 0, 0],
251
+            'MIN' => [6, -1, 0, 0],
252
+            'MAX' => [7, -1, 0, 0],
253
+            'ROW' => [8, -1, 0, 0],
254
+            'COLUMN' => [9, -1, 0, 0],
255
+            'NA' => [10, 0, 0, 0],
256
+            'NPV' => [11, -1, 1, 0],
257
+            'STDEV' => [12, -1, 0, 0],
258
+            'DOLLAR' => [13, -1, 1, 0],
259
+            'FIXED' => [14, -1, 1, 0],
260
+            'SIN' => [15, 1, 1, 0],
261
+            'COS' => [16, 1, 1, 0],
262
+            'TAN' => [17, 1, 1, 0],
263
+            'ATAN' => [18, 1, 1, 0],
264
+            'PI' => [19, 0, 1, 0],
265
+            'SQRT' => [20, 1, 1, 0],
266
+            'EXP' => [21, 1, 1, 0],
267
+            'LN' => [22, 1, 1, 0],
268
+            'LOG10' => [23, 1, 1, 0],
269
+            'ABS' => [24, 1, 1, 0],
270
+            'INT' => [25, 1, 1, 0],
271
+            'SIGN' => [26, 1, 1, 0],
272
+            'ROUND' => [27, 2, 1, 0],
273
+            'LOOKUP' => [28, -1, 0, 0],
274
+            'INDEX' => [29, -1, 0, 1],
275
+            'REPT' => [30, 2, 1, 0],
276
+            'MID' => [31, 3, 1, 0],
277
+            'LEN' => [32, 1, 1, 0],
278
+            'VALUE' => [33, 1, 1, 0],
279
+            'TRUE' => [34, 0, 1, 0],
280
+            'FALSE' => [35, 0, 1, 0],
281
+            'AND' => [36, -1, 0, 0],
282
+            'OR' => [37, -1, 0, 0],
283
+            'NOT' => [38, 1, 1, 0],
284
+            'MOD' => [39, 2, 1, 0],
285
+            'DCOUNT' => [40, 3, 0, 0],
286
+            'DSUM' => [41, 3, 0, 0],
287
+            'DAVERAGE' => [42, 3, 0, 0],
288
+            'DMIN' => [43, 3, 0, 0],
289
+            'DMAX' => [44, 3, 0, 0],
290
+            'DSTDEV' => [45, 3, 0, 0],
291
+            'VAR' => [46, -1, 0, 0],
292
+            'DVAR' => [47, 3, 0, 0],
293
+            'TEXT' => [48, 2, 1, 0],
294
+            'LINEST' => [49, -1, 0, 0],
295
+            'TREND' => [50, -1, 0, 0],
296
+            'LOGEST' => [51, -1, 0, 0],
297
+            'GROWTH' => [52, -1, 0, 0],
298
+            'PV' => [56, -1, 1, 0],
299
+            'FV' => [57, -1, 1, 0],
300
+            'NPER' => [58, -1, 1, 0],
301
+            'PMT' => [59, -1, 1, 0],
302
+            'RATE' => [60, -1, 1, 0],
303
+            'MIRR' => [61, 3, 0, 0],
304
+            'IRR' => [62, -1, 0, 0],
305
+            'RAND' => [63, 0, 1, 1],
306
+            'MATCH' => [64, -1, 0, 0],
307
+            'DATE' => [65, 3, 1, 0],
308
+            'TIME' => [66, 3, 1, 0],
309
+            'DAY' => [67, 1, 1, 0],
310
+            'MONTH' => [68, 1, 1, 0],
311
+            'YEAR' => [69, 1, 1, 0],
312
+            'WEEKDAY' => [70, -1, 1, 0],
313
+            'HOUR' => [71, 1, 1, 0],
314
+            'MINUTE' => [72, 1, 1, 0],
315
+            'SECOND' => [73, 1, 1, 0],
316
+            'NOW' => [74, 0, 1, 1],
317
+            'AREAS' => [75, 1, 0, 1],
318
+            'ROWS' => [76, 1, 0, 1],
319
+            'COLUMNS' => [77, 1, 0, 1],
320
+            'OFFSET' => [78, -1, 0, 1],
321
+            'SEARCH' => [82, -1, 1, 0],
322
+            'TRANSPOSE' => [83, 1, 1, 0],
323
+            'TYPE' => [86, 1, 1, 0],
324
+            'ATAN2' => [97, 2, 1, 0],
325
+            'ASIN' => [98, 1, 1, 0],
326
+            'ACOS' => [99, 1, 1, 0],
327
+            'CHOOSE' => [100, -1, 1, 0],
328
+            'HLOOKUP' => [101, -1, 0, 0],
329
+            'VLOOKUP' => [102, -1, 0, 0],
330
+            'ISREF' => [105, 1, 0, 0],
331
+            'LOG' => [109, -1, 1, 0],
332
+            'CHAR' => [111, 1, 1, 0],
333
+            'LOWER' => [112, 1, 1, 0],
334
+            'UPPER' => [113, 1, 1, 0],
335
+            'PROPER' => [114, 1, 1, 0],
336
+            'LEFT' => [115, -1, 1, 0],
337
+            'RIGHT' => [116, -1, 1, 0],
338
+            'EXACT' => [117, 2, 1, 0],
339
+            'TRIM' => [118, 1, 1, 0],
340
+            'REPLACE' => [119, 4, 1, 0],
341
+            'SUBSTITUTE' => [120, -1, 1, 0],
342
+            'CODE' => [121, 1, 1, 0],
343
+            'FIND' => [124, -1, 1, 0],
344
+            'CELL' => [125, -1, 0, 1],
345
+            'ISERR' => [126, 1, 1, 0],
346
+            'ISTEXT' => [127, 1, 1, 0],
347
+            'ISNUMBER' => [128, 1, 1, 0],
348
+            'ISBLANK' => [129, 1, 1, 0],
349
+            'T' => [130, 1, 0, 0],
350
+            'N' => [131, 1, 0, 0],
351
+            'DATEVALUE' => [140, 1, 1, 0],
352
+            'TIMEVALUE' => [141, 1, 1, 0],
353
+            'SLN' => [142, 3, 1, 0],
354
+            'SYD' => [143, 4, 1, 0],
355
+            'DDB' => [144, -1, 1, 0],
356
+            'INDIRECT' => [148, -1, 1, 1],
357
+            'CALL' => [150, -1, 1, 0],
358
+            'CLEAN' => [162, 1, 1, 0],
359
+            'MDETERM' => [163, 1, 2, 0],
360
+            'MINVERSE' => [164, 1, 2, 0],
361
+            'MMULT' => [165, 2, 2, 0],
362
+            'IPMT' => [167, -1, 1, 0],
363
+            'PPMT' => [168, -1, 1, 0],
364
+            'COUNTA' => [169, -1, 0, 0],
365
+            'PRODUCT' => [183, -1, 0, 0],
366
+            'FACT' => [184, 1, 1, 0],
367
+            'DPRODUCT' => [189, 3, 0, 0],
368
+            'ISNONTEXT' => [190, 1, 1, 0],
369
+            'STDEVP' => [193, -1, 0, 0],
370
+            'VARP' => [194, -1, 0, 0],
371
+            'DSTDEVP' => [195, 3, 0, 0],
372
+            'DVARP' => [196, 3, 0, 0],
373
+            'TRUNC' => [197, -1, 1, 0],
374
+            'ISLOGICAL' => [198, 1, 1, 0],
375
+            'DCOUNTA' => [199, 3, 0, 0],
376
+            'USDOLLAR' => [204, -1, 1, 0],
377
+            'FINDB' => [205, -1, 1, 0],
378
+            'SEARCHB' => [206, -1, 1, 0],
379
+            'REPLACEB' => [207, 4, 1, 0],
380
+            'LEFTB' => [208, -1, 1, 0],
381
+            'RIGHTB' => [209, -1, 1, 0],
382
+            'MIDB' => [210, 3, 1, 0],
383
+            'LENB' => [211, 1, 1, 0],
384
+            'ROUNDUP' => [212, 2, 1, 0],
385
+            'ROUNDDOWN' => [213, 2, 1, 0],
386
+            'ASC' => [214, 1, 1, 0],
387
+            'DBCS' => [215, 1, 1, 0],
388
+            'RANK' => [216, -1, 0, 0],
389
+            'ADDRESS' => [219, -1, 1, 0],
390
+            'DAYS360' => [220, -1, 1, 0],
391
+            'TODAY' => [221, 0, 1, 1],
392
+            'VDB' => [222, -1, 1, 0],
393
+            'MEDIAN' => [227, -1, 0, 0],
394
+            'SUMPRODUCT' => [228, -1, 2, 0],
395
+            'SINH' => [229, 1, 1, 0],
396
+            'COSH' => [230, 1, 1, 0],
397
+            'TANH' => [231, 1, 1, 0],
398
+            'ASINH' => [232, 1, 1, 0],
399
+            'ACOSH' => [233, 1, 1, 0],
400
+            'ATANH' => [234, 1, 1, 0],
401
+            'DGET' => [235, 3, 0, 0],
402
+            'INFO' => [244, 1, 1, 1],
403
+            'DB' => [247, -1, 1, 0],
404
+            'FREQUENCY' => [252, 2, 0, 0],
405
+            'ERROR.TYPE' => [261, 1, 1, 0],
406
+            'REGISTER.ID' => [267, -1, 1, 0],
407
+            'AVEDEV' => [269, -1, 0, 0],
408
+            'BETADIST' => [270, -1, 1, 0],
409
+            'GAMMALN' => [271, 1, 1, 0],
410
+            'BETAINV' => [272, -1, 1, 0],
411
+            'BINOMDIST' => [273, 4, 1, 0],
412
+            'CHIDIST' => [274, 2, 1, 0],
413
+            'CHIINV' => [275, 2, 1, 0],
414
+            'COMBIN' => [276, 2, 1, 0],
415
+            'CONFIDENCE' => [277, 3, 1, 0],
416
+            'CRITBINOM' => [278, 3, 1, 0],
417
+            'EVEN' => [279, 1, 1, 0],
418
+            'EXPONDIST' => [280, 3, 1, 0],
419
+            'FDIST' => [281, 3, 1, 0],
420
+            'FINV' => [282, 3, 1, 0],
421
+            'FISHER' => [283, 1, 1, 0],
422
+            'FISHERINV' => [284, 1, 1, 0],
423
+            'FLOOR' => [285, 2, 1, 0],
424
+            'GAMMADIST' => [286, 4, 1, 0],
425
+            'GAMMAINV' => [287, 3, 1, 0],
426
+            'CEILING' => [288, 2, 1, 0],
427
+            'HYPGEOMDIST' => [289, 4, 1, 0],
428
+            'LOGNORMDIST' => [290, 3, 1, 0],
429
+            'LOGINV' => [291, 3, 1, 0],
430
+            'NEGBINOMDIST' => [292, 3, 1, 0],
431
+            'NORMDIST' => [293, 4, 1, 0],
432
+            'NORMSDIST' => [294, 1, 1, 0],
433
+            'NORMINV' => [295, 3, 1, 0],
434
+            'NORMSINV' => [296, 1, 1, 0],
435
+            'STANDARDIZE' => [297, 3, 1, 0],
436
+            'ODD' => [298, 1, 1, 0],
437
+            'PERMUT' => [299, 2, 1, 0],
438
+            'POISSON' => [300, 3, 1, 0],
439
+            'TDIST' => [301, 3, 1, 0],
440
+            'WEIBULL' => [302, 4, 1, 0],
441
+            'SUMXMY2' => [303, 2, 2, 0],
442
+            'SUMX2MY2' => [304, 2, 2, 0],
443
+            'SUMX2PY2' => [305, 2, 2, 0],
444
+            'CHITEST' => [306, 2, 2, 0],
445
+            'CORREL' => [307, 2, 2, 0],
446
+            'COVAR' => [308, 2, 2, 0],
447
+            'FORECAST' => [309, 3, 2, 0],
448
+            'FTEST' => [310, 2, 2, 0],
449
+            'INTERCEPT' => [311, 2, 2, 0],
450
+            'PEARSON' => [312, 2, 2, 0],
451
+            'RSQ' => [313, 2, 2, 0],
452
+            'STEYX' => [314, 2, 2, 0],
453
+            'SLOPE' => [315, 2, 2, 0],
454
+            'TTEST' => [316, 4, 2, 0],
455
+            'PROB' => [317, -1, 2, 0],
456
+            'DEVSQ' => [318, -1, 0, 0],
457
+            'GEOMEAN' => [319, -1, 0, 0],
458
+            'HARMEAN' => [320, -1, 0, 0],
459
+            'SUMSQ' => [321, -1, 0, 0],
460
+            'KURT' => [322, -1, 0, 0],
461
+            'SKEW' => [323, -1, 0, 0],
462
+            'ZTEST' => [324, -1, 0, 0],
463
+            'LARGE' => [325, 2, 0, 0],
464
+            'SMALL' => [326, 2, 0, 0],
465
+            'QUARTILE' => [327, 2, 0, 0],
466
+            'PERCENTILE' => [328, 2, 0, 0],
467
+            'PERCENTRANK' => [329, -1, 0, 0],
468
+            'MODE' => [330, -1, 2, 0],
469
+            'TRIMMEAN' => [331, 2, 0, 0],
470
+            'TINV' => [332, 2, 1, 0],
471
+            'CONCATENATE' => [336, -1, 1, 0],
472
+            'POWER' => [337, 2, 1, 0],
473
+            'RADIANS' => [342, 1, 1, 0],
474
+            'DEGREES' => [343, 1, 1, 0],
475
+            'SUBTOTAL' => [344, -1, 0, 0],
476
+            'SUMIF' => [345, -1, 0, 0],
477
+            'COUNTIF' => [346, 2, 0, 0],
478
+            'COUNTBLANK' => [347, 1, 0, 0],
479
+            'ISPMT' => [350, 4, 1, 0],
480
+            'DATEDIF' => [351, 3, 1, 0],
481
+            'DATESTRING' => [352, 1, 1, 0],
482
+            'NUMBERSTRING' => [353, 2, 1, 0],
483
+            'ROMAN' => [354, -1, 1, 0],
484
+            'GETPIVOTDATA' => [358, -1, 0, 0],
485
+            'HYPERLINK' => [359, -1, 1, 0],
486
+            'PHONETIC' => [360, 1, 0, 0],
487
+            'AVERAGEA' => [361, -1, 0, 0],
488
+            'MAXA' => [362, -1, 0, 0],
489
+            'MINA' => [363, -1, 0, 0],
490
+            'STDEVPA' => [364, -1, 0, 0],
491
+            'VARPA' => [365, -1, 0, 0],
492
+            'STDEVA' => [366, -1, 0, 0],
493
+            'VARA' => [367, -1, 0, 0],
494
+            'BAHTTEXT' => [368, 1, 0, 0],
495 495
         ];
496 496
     }
497 497
 
@@ -1318,12 +1318,12 @@  discard block
 block discarded – undo
1318 1318
     private function fact()
1319 1319
     {
1320 1320
         if ($this->currentToken == '(') {
1321
-            $this->advance();         // eat the "("
1321
+            $this->advance(); // eat the "("
1322 1322
             $result = $this->parenthesizedExpression();
1323 1323
             if ($this->currentToken != ')') {
1324 1324
                 throw new \PhpSpreadsheet\Writer\Exception("')' token expected.");
1325 1325
             }
1326
-            $this->advance();         // eat the ")"
1326
+            $this->advance(); // eat the ")"
1327 1327
             return $result;
1328 1328
         }
1329 1329
         // if it's a reference
@@ -1372,7 +1372,7 @@  discard block
 block discarded – undo
1372 1372
             // If it's a number or a percent
1373 1373
             if ($this->lookAhead == '%') {
1374 1374
                 $result = $this->createTree('ptgPercent', $this->currentToken, '');
1375
-                $this->advance();  // Skip the percentage operator once we've pre-built that tree
1375
+                $this->advance(); // Skip the percentage operator once we've pre-built that tree
1376 1376
             } else {
1377 1377
                 $result = $this->createTree($this->currentToken, '', '');
1378 1378
             }
@@ -1400,12 +1400,12 @@  discard block
 block discarded – undo
1400 1400
         $function = strtoupper($this->currentToken);
1401 1401
         $result = ''; // initialize result
1402 1402
         $this->advance();
1403
-        $this->advance();         // eat the "("
1403
+        $this->advance(); // eat the "("
1404 1404
         while ($this->currentToken != ')') {
1405 1405
             /**/
1406 1406
             if ($num_args > 0) {
1407 1407
                 if ($this->currentToken == ',' || $this->currentToken == ';') {
1408
-                    $this->advance();  // eat the "," or ";"
1408
+                    $this->advance(); // eat the "," or ";"
1409 1409
                 } else {
1410 1410
                     throw new \PhpSpreadsheet\Writer\Exception("Syntax error: comma expected in function $function, arg #{$num_args}");
1411 1411
                 }
@@ -1427,7 +1427,7 @@  discard block
 block discarded – undo
1427 1427
         }
1428 1428
 
1429 1429
         $result = $this->createTree($function, $result, $num_args);
1430
-        $this->advance();         // eat the ")"
1430
+        $this->advance(); // eat the ")"
1431 1431
         return $result;
1432 1432
     }
1433 1433
 
Please login to merge, or discard this patch.
src/PhpSpreadsheet/Writer/Excel5/Workbook.php 1 patch
Spacing   +76 added lines, -76 removed lines patch added patch discarded remove patch
@@ -219,11 +219,11 @@  discard block
 block discarded – undo
219 219
         for ($i = 0; $i < $countSheets; ++$i) {
220 220
             $phpSheet = $spreadsheet->getSheet($i);
221 221
 
222
-            $this->parser->setExtSheet($phpSheet->getTitle(), $i);  // Register worksheet name with parser
222
+            $this->parser->setExtSheet($phpSheet->getTitle(), $i); // Register worksheet name with parser
223 223
 
224 224
             $supbook_index = 0x00;
225 225
             $ref = pack('vvv', $supbook_index, $i, $i);
226
-            $this->parser->references[] = $ref;  // Register reference with parser
226
+            $this->parser->references[] = $ref; // Register reference with parser
227 227
 
228 228
             // Sheet tab colors?
229 229
             if ($phpSheet->isTabColorSet()) {
@@ -467,7 +467,7 @@  discard block
 block discarded – undo
467 467
      */
468 468
     private function calcSheetOffsets()
469 469
     {
470
-        $boundsheet_length = 10;  // fixed length for a BOUNDSHEET record
470
+        $boundsheet_length = 10; // fixed length for a BOUNDSHEET record
471 471
 
472 472
         // size of Workbook globals part 1 + 3
473 473
         $offset = $this->_datasize;
@@ -831,7 +831,7 @@  discard block
 block discarded – undo
831 831
         $record = 0x0018;
832 832
 
833 833
         // option flags
834
-        $options = ($isHidden  ? 0x21 : 0x00);
834
+        $options = ($isHidden ? 0x21 : 0x00);
835 835
 
836 836
         $extra = pack(
837 837
             'Cvvvvv',
@@ -861,9 +861,9 @@  discard block
 block discarded – undo
861 861
      */
862 862
     private function writeCodepage()
863 863
     {
864
-        $record = 0x0042;             // Record identifier
865
-        $length = 0x0002;             // Number of bytes to follow
866
-        $cv = $this->codepage;   // The code page
864
+        $record = 0x0042; // Record identifier
865
+        $length = 0x0002; // Number of bytes to follow
866
+        $cv = $this->codepage; // The code page
867 867
 
868 868
         $header = pack('vv', $record, $length);
869 869
         $data = pack('v', $cv);
@@ -876,24 +876,24 @@  discard block
 block discarded – undo
876 876
      */
877 877
     private function writeWindow1()
878 878
     {
879
-        $record = 0x003D;   // Record identifier
880
-        $length = 0x0012;   // Number of bytes to follow
879
+        $record = 0x003D; // Record identifier
880
+        $length = 0x0012; // Number of bytes to follow
881 881
 
882
-        $xWn = 0x0000;     // Horizontal position of window
883
-        $yWn = 0x0000;     // Vertical position of window
884
-        $dxWn = 0x25BC;     // Width of window
885
-        $dyWn = 0x1572;     // Height of window
882
+        $xWn = 0x0000; // Horizontal position of window
883
+        $yWn = 0x0000; // Vertical position of window
884
+        $dxWn = 0x25BC; // Width of window
885
+        $dyWn = 0x1572; // Height of window
886 886
 
887
-        $grbit = 0x0038;    // Option flags
887
+        $grbit = 0x0038; // Option flags
888 888
 
889 889
         // not supported by PhpSpreadsheet, so there is only one selected sheet, the active
890
-        $ctabsel = 1;       // Number of workbook tabs selected
890
+        $ctabsel = 1; // Number of workbook tabs selected
891 891
 
892
-        $wTabRatio = 0x0258;    // Tab to scrollbar ratio
892
+        $wTabRatio = 0x0258; // Tab to scrollbar ratio
893 893
 
894 894
         // not supported by PhpSpreadsheet, set to 0
895
-        $itabFirst = 0;     // 1st displayed worksheet
896
-        $itabCur = $this->spreadsheet->getActiveSheetIndex();    // Active worksheet
895
+        $itabFirst = 0; // 1st displayed worksheet
896
+        $itabCur = $this->spreadsheet->getActiveSheetIndex(); // Active worksheet
897 897
 
898 898
         $header = pack('vv', $record, $length);
899 899
         $data = pack('vvvvvvvvv', $xWn, $yWn, $dxWn, $dyWn, $grbit, $itabCur, $itabFirst, $ctabsel, $wTabRatio);
@@ -909,7 +909,7 @@  discard block
 block discarded – undo
909 909
     private function writeBoundSheet($sheet, $offset)
910 910
     {
911 911
         $sheetname = $sheet->getTitle();
912
-        $record = 0x0085;                    // Record identifier
912
+        $record = 0x0085; // Record identifier
913 913
 
914 914
         // sheet state
915 915
         switch ($sheet->getSheetState()) {
@@ -930,7 +930,7 @@  discard block
 block discarded – undo
930 930
         // sheet type
931 931
         $st = 0x00;
932 932
 
933
-        $grbit = 0x0000;                    // Visibility and sheet type
933
+        $grbit = 0x0000; // Visibility and sheet type
934 934
 
935 935
         $data = pack('VCC', $offset, $ss, $st);
936 936
         $data .= \PhpSpreadsheet\Shared\StringHelper::UTF8toBIFF8UnicodeShort($sheetname);
@@ -945,8 +945,8 @@  discard block
 block discarded – undo
945 945
      */
946 946
     private function writeSupbookInternal()
947 947
     {
948
-        $record = 0x01AE;   // Record identifier
949
-        $length = 0x0004;   // Bytes to follow
948
+        $record = 0x01AE; // Record identifier
949
+        $length = 0x0004; // Bytes to follow
950 950
 
951 951
         $header = pack('vv', $record, $length);
952 952
         $data = pack('vv', $this->spreadsheet->getSheetCount(), 0x0401);
@@ -961,10 +961,10 @@  discard block
 block discarded – undo
961 961
     private function writeExternalsheetBiff8()
962 962
     {
963 963
         $totalReferences = count($this->parser->references);
964
-        $record = 0x0017;                     // Record identifier
965
-        $length = 2 + 6 * $totalReferences;  // Number of bytes to follow
964
+        $record = 0x0017; // Record identifier
965
+        $length = 2 + 6 * $totalReferences; // Number of bytes to follow
966 966
 
967
-        $supbook_index = 0;           // FIXME: only using internal SUPBOOK record
967
+        $supbook_index = 0; // FIXME: only using internal SUPBOOK record
968 968
         $header = pack('vv', $record, $length);
969 969
         $data = pack('v', $totalReferences);
970 970
         for ($i = 0; $i < $totalReferences; ++$i) {
@@ -979,12 +979,12 @@  discard block
 block discarded – undo
979 979
      */
980 980
     private function writeStyle()
981 981
     {
982
-        $record = 0x0293;   // Record identifier
983
-        $length = 0x0004;   // Bytes to follow
982
+        $record = 0x0293; // Record identifier
983
+        $length = 0x0004; // Bytes to follow
984 984
 
985
-        $ixfe = 0x8000;  // Index to cell style XF
986
-        $BuiltIn = 0x00;     // Built-in style
987
-        $iLevel = 0xff;     // Outline style level
985
+        $ixfe = 0x8000; // Index to cell style XF
986
+        $BuiltIn = 0x00; // Built-in style
987
+        $iLevel = 0xff; // Outline style level
988 988
 
989 989
         $header = pack('vv', $record, $length);
990 990
         $data = pack('vCC', $ixfe, $BuiltIn, $iLevel);
@@ -999,10 +999,10 @@  discard block
 block discarded – undo
999 999
      */
1000 1000
     private function writeNumberFormat($format, $ifmt)
1001 1001
     {
1002
-        $record = 0x041E;    // Record identifier
1002
+        $record = 0x041E; // Record identifier
1003 1003
 
1004 1004
         $numberFormatString = \PhpSpreadsheet\Shared\StringHelper::UTF8toBIFF8UnicodeLong($format);
1005
-        $length = 2 + strlen($numberFormatString);    // Number of bytes to follow
1005
+        $length = 2 + strlen($numberFormatString); // Number of bytes to follow
1006 1006
 
1007 1007
         $header = pack('vv', $record, $length);
1008 1008
         $data = pack('v', $ifmt) . $numberFormatString;
@@ -1014,12 +1014,12 @@  discard block
 block discarded – undo
1014 1014
      */
1015 1015
     private function writeDateMode()
1016 1016
     {
1017
-        $record = 0x0022;   // Record identifier
1018
-        $length = 0x0002;   // Bytes to follow
1017
+        $record = 0x0022; // Record identifier
1018
+        $length = 0x0002; // Bytes to follow
1019 1019
 
1020 1020
         $f1904 = (\PhpSpreadsheet\Shared\Date::getExcelCalendar() == \PhpSpreadsheet\Shared\Date::CALENDAR_MAC_1904)
1021 1021
             ? 1
1022
-            : 0;   // Flag for 1904 date system
1022
+            : 0; // Flag for 1904 date system
1023 1023
 
1024 1024
         $header = pack('vv', $record, $length);
1025 1025
         $data = pack('v', $f1904);
@@ -1040,8 +1040,8 @@  discard block
 block discarded – undo
1040 1040
      */
1041 1041
     private function writeExternalCount($cxals)
1042 1042
     {
1043
-        $record = 0x0016;   // Record identifier
1044
-        $length = 0x0002;   // Number of bytes to follow
1043
+        $record = 0x0016; // Record identifier
1044
+        $length = 0x0002; // Number of bytes to follow
1045 1045
 
1046 1046
         $header = pack('vv', $record, $length);
1047 1047
         $data = pack('v', $cxals);
@@ -1059,11 +1059,11 @@  discard block
 block discarded – undo
1059 1059
      */
1060 1060
     private function writeExternalSheet($sheetname)
1061 1061
     {
1062
-        $record = 0x0017;                     // Record identifier
1063
-        $length = 0x02 + strlen($sheetname);  // Number of bytes to follow
1062
+        $record = 0x0017; // Record identifier
1063
+        $length = 0x02 + strlen($sheetname); // Number of bytes to follow
1064 1064
 
1065
-        $cch = strlen($sheetname);         // Length of sheet name
1066
-        $rgch = 0x03;                       // Filename encoding
1065
+        $cch = strlen($sheetname); // Length of sheet name
1066
+        $rgch = 0x03; // Filename encoding
1067 1067
 
1068 1068
         $header = pack('vv', $record, $length);
1069 1069
         $data = pack('CC', $cch, $rgch);
@@ -1083,20 +1083,20 @@  discard block
 block discarded – undo
1083 1083
      */
1084 1084
     private function writeNameShort($index, $type, $rowmin, $rowmax, $colmin, $colmax)
1085 1085
     {
1086
-        $record = 0x0018;       // Record identifier
1087
-        $length = 0x0024;       // Number of bytes to follow
1088
-
1089
-        $grbit = 0x0020;       // Option flags
1090
-        $chKey = 0x00;         // Keyboard shortcut
1091
-        $cch = 0x01;         // Length of text name
1092
-        $cce = 0x0015;       // Length of text definition
1093
-        $ixals = $index + 1;   // Sheet index
1094
-        $itab = $ixals;       // Equal to ixals
1095
-        $cchCustMenu = 0x00;         // Length of cust menu text
1096
-        $cchDescription = 0x00;         // Length of description text
1097
-        $cchHelptopic = 0x00;         // Length of help topic text
1098
-        $cchStatustext = 0x00;         // Length of status bar text
1099
-        $rgch = $type;        // Built-in name type
1086
+        $record = 0x0018; // Record identifier
1087
+        $length = 0x0024; // Number of bytes to follow
1088
+
1089
+        $grbit = 0x0020; // Option flags
1090
+        $chKey = 0x00; // Keyboard shortcut
1091
+        $cch = 0x01; // Length of text name
1092
+        $cce = 0x0015; // Length of text definition
1093
+        $ixals = $index + 1; // Sheet index
1094
+        $itab = $ixals; // Equal to ixals
1095
+        $cchCustMenu = 0x00; // Length of cust menu text
1096
+        $cchDescription = 0x00; // Length of description text
1097
+        $cchHelptopic = 0x00; // Length of help topic text
1098
+        $cchStatustext = 0x00; // Length of status bar text
1099
+        $rgch = $type; // Built-in name type
1100 1100
 
1101 1101
         $unknown03 = 0x3b;
1102 1102
         $unknown04 = 0xffff - $index;
@@ -1147,19 +1147,19 @@  discard block
 block discarded – undo
1147 1147
      */
1148 1148
     private function writeNameLong($index, $type, $rowmin, $rowmax, $colmin, $colmax)
1149 1149
     {
1150
-        $record = 0x0018;       // Record identifier
1151
-        $length = 0x003d;       // Number of bytes to follow
1152
-        $grbit = 0x0020;       // Option flags
1153
-        $chKey = 0x00;         // Keyboard shortcut
1154
-        $cch = 0x01;         // Length of text name
1155
-        $cce = 0x002e;       // Length of text definition
1156
-        $ixals = $index + 1;   // Sheet index
1157
-        $itab = $ixals;       // Equal to ixals
1158
-        $cchCustMenu = 0x00;         // Length of cust menu text
1159
-        $cchDescription = 0x00;         // Length of description text
1160
-        $cchHelptopic = 0x00;         // Length of help topic text
1161
-        $cchStatustext = 0x00;         // Length of status bar text
1162
-        $rgch = $type;        // Built-in name type
1150
+        $record = 0x0018; // Record identifier
1151
+        $length = 0x003d; // Number of bytes to follow
1152
+        $grbit = 0x0020; // Option flags
1153
+        $chKey = 0x00; // Keyboard shortcut
1154
+        $cch = 0x01; // Length of text name
1155
+        $cce = 0x002e; // Length of text definition
1156
+        $ixals = $index + 1; // Sheet index
1157
+        $itab = $ixals; // Equal to ixals
1158
+        $cchCustMenu = 0x00; // Length of cust menu text
1159
+        $cchDescription = 0x00; // Length of description text
1160
+        $cchHelptopic = 0x00; // Length of help topic text
1161
+        $cchStatustext = 0x00; // Length of status bar text
1162
+        $rgch = $type; // Built-in name type
1163 1163
 
1164 1164
         $unknown01 = 0x29;
1165 1165
         $unknown02 = 0x002b;
@@ -1222,8 +1222,8 @@  discard block
 block discarded – undo
1222 1222
      */
1223 1223
     private function writeCountry()
1224 1224
     {
1225
-        $record = 0x008C;    // Record identifier
1226
-        $length = 4;         // Number of bytes to follow
1225
+        $record = 0x008C; // Record identifier
1226
+        $length = 4; // Number of bytes to follow
1227 1227
 
1228 1228
         $header = pack('vv', $record, $length);
1229 1229
         /* using the same country code always for simplicity */
@@ -1239,8 +1239,8 @@  discard block
 block discarded – undo
1239 1239
      */
1240 1240
     private function writeRecalcId()
1241 1241
     {
1242
-        $record = 0x01C1;    // Record identifier
1243
-        $length = 8;         // Number of bytes to follow
1242
+        $record = 0x01C1; // Record identifier
1243
+        $length = 8; // Number of bytes to follow
1244 1244
 
1245 1245
         $header = pack('vv', $record, $length);
1246 1246
 
@@ -1257,10 +1257,10 @@  discard block
 block discarded – undo
1257 1257
     {
1258 1258
         $aref = $this->palette;
1259 1259
 
1260
-        $record = 0x0092;                // Record identifier
1261
-        $length = 2 + 4 * count($aref);  // Number of bytes to follow
1262
-        $ccv = count($aref);          // Number of RGB values to follow
1263
-        $data = '';                      // The RGB data
1260
+        $record = 0x0092; // Record identifier
1261
+        $length = 2 + 4 * count($aref); // Number of bytes to follow
1262
+        $ccv = count($aref); // Number of RGB values to follow
1263
+        $data = ''; // The RGB data
1264 1264
 
1265 1265
         // Pack the RGB data
1266 1266
         foreach ($aref as $color) {
Please login to merge, or discard this patch.
src/PhpSpreadsheet/Writer/Excel2007.php 2 patches
Indentation   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -138,8 +138,8 @@
 block discarded – undo
138 138
         }
139 139
 
140 140
         $hashTablesArray = ['stylesConditionalHashTable',    'fillHashTable',        'fontHashTable',
141
-                                  'bordersHashTable',                'numFmtHashTable',        'drawingHashTable',
142
-                                  'styleHashTable',
141
+                                    'bordersHashTable',                'numFmtHashTable',        'drawingHashTable',
142
+                                    'styleHashTable',
143 143
                                 ];
144 144
 
145 145
         // Set HashTable variables
Please login to merge, or discard this patch.
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -137,8 +137,8 @@  discard block
 block discarded – undo
137 137
             $this->writerParts[$writer] = new $class($this);
138 138
         }
139 139
 
140
-        $hashTablesArray = ['stylesConditionalHashTable',    'fillHashTable',        'fontHashTable',
141
-                                  'bordersHashTable',                'numFmtHashTable',        'drawingHashTable',
140
+        $hashTablesArray = ['stylesConditionalHashTable', 'fillHashTable', 'fontHashTable',
141
+                                  'bordersHashTable', 'numFmtHashTable', 'drawingHashTable',
142 142
                                   'styleHashTable',
143 143
                                 ];
144 144
 
@@ -235,7 +235,7 @@  discard block
 block discarded – undo
235 235
                 $macrosCode = $this->spreadSheet->getMacrosCode();
236 236
                 if (!is_null($macrosCode)) {
237 237
                     // we have the code ?
238
-                    $objZip->addFromString('xl/vbaProject.bin', $macrosCode);//allways in 'xl', allways named vbaProject.bin
238
+                    $objZip->addFromString('xl/vbaProject.bin', $macrosCode); //allways in 'xl', allways named vbaProject.bin
239 239
                     if ($this->spreadSheet->hasMacrosCertificate()) {
240 240
                         //signed macros ?
241 241
                         // Yes : add the certificate file and the related rels file
@@ -250,7 +250,7 @@  discard block
 block discarded – undo
250 250
                 $objZip->addFromString($tmpRibbonTarget, $this->spreadSheet->getRibbonXMLData('data'));
251 251
                 if ($this->spreadSheet->hasRibbonBinObjects()) {
252 252
                     $tmpRootPath = dirname($tmpRibbonTarget) . '/';
253
-                    $ribbonBinObjects = $this->spreadSheet->getRibbonBinObjects('data');//the files to write
253
+                    $ribbonBinObjects = $this->spreadSheet->getRibbonBinObjects('data'); //the files to write
254 254
                     foreach ($ribbonBinObjects as $aPath => $aContent) {
255 255
                         $objZip->addFromString($tmpRootPath . $aPath, $aContent);
256 256
                     }
Please login to merge, or discard this patch.
src/PhpSpreadsheet/Writer/Excel2007/ContentTypes.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -157,7 +157,7 @@
 block discarded – undo
157 157
             // we need to write "Extension" but not already write for media content
158 158
             $tabRibbonTypes = array_diff($spreadsheet->getRibbonBinObjects('types'), array_keys($aMediaContentTypes));
159 159
             foreach ($tabRibbonTypes as $aRibbonType) {
160
-                $mimeType = 'image/.' . $aRibbonType;//we wrote $mimeType like customUI Editor
160
+                $mimeType = 'image/.' . $aRibbonType; //we wrote $mimeType like customUI Editor
161 161
                 $this->writeDefaultContentType($objWriter, $aRibbonType, $mimeType);
162 162
             }
163 163
         }
Please login to merge, or discard this patch.
src/PhpSpreadsheet/Writer/Excel2007/Style.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -621,7 +621,7 @@  discard block
 block discarded – undo
621 621
         /** @var \PhpSpreadsheet\Style $style */
622 622
         foreach ($aStyles as $style) {
623 623
             if (!array_key_exists($style->getFill()->getHashCode(), $aFills)) {
624
-                $aFills[ $style->getFill()->getHashCode() ] = $style->getFill();
624
+                $aFills[$style->getFill()->getHashCode()] = $style->getFill();
625 625
             }
626 626
         }
627 627
 
@@ -644,7 +644,7 @@  discard block
 block discarded – undo
644 644
         /** @var \PhpSpreadsheet\Style $style */
645 645
         foreach ($aStyles as $style) {
646 646
             if (!array_key_exists($style->getFont()->getHashCode(), $aFonts)) {
647
-                $aFonts[ $style->getFont()->getHashCode() ] = $style->getFont();
647
+                $aFonts[$style->getFont()->getHashCode()] = $style->getFont();
648 648
             }
649 649
         }
650 650
 
@@ -667,7 +667,7 @@  discard block
 block discarded – undo
667 667
         /** @var \PhpSpreadsheet\Style $style */
668 668
         foreach ($aStyles as $style) {
669 669
             if (!array_key_exists($style->getBorders()->getHashCode(), $aBorders)) {
670
-                $aBorders[ $style->getBorders()->getHashCode() ] = $style->getBorders();
670
+                $aBorders[$style->getBorders()->getHashCode()] = $style->getBorders();
671 671
             }
672 672
         }
673 673
 
@@ -690,7 +690,7 @@  discard block
 block discarded – undo
690 690
         /** @var \PhpSpreadsheet\Style $style */
691 691
         foreach ($aStyles as $style) {
692 692
             if ($style->getNumberFormat()->getBuiltInFormatCode() === false && !array_key_exists($style->getNumberFormat()->getHashCode(), $aNumFmts)) {
693
-                $aNumFmts[ $style->getNumberFormat()->getHashCode() ] = $style->getNumberFormat();
693
+                $aNumFmts[$style->getNumberFormat()->getHashCode()] = $style->getNumberFormat();
694 694
             }
695 695
         }
696 696
 
Please login to merge, or discard this patch.