Completed
Push — master ( f8ae6c...586510 )
by Once
01:58
created
example.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -99,9 +99,9 @@
 block discarded – undo
99 99
 {
100 100
     return [
101 101
         'SKU' => 'string',
102
-        '尺码' => 'string',  // sku
103
-        '净重' => 'string',  // sku
104
-        '单价' => 'prices',  // sku
102
+        '尺码' => 'string', // sku
103
+        '净重' => 'string', // sku
104
+        '单价' => 'prices', // sku
105 105
     ];
106 106
 }
107 107
 
Please login to merge, or discard this patch.
src/Support.php 1 patch
Spacing   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -22,13 +22,13 @@  discard block
 block discarded – undo
22 22
     {
23 23
         $n = $columnNumber;
24 24
         for ($r = ''; $n >= 0; $n = intval($n / 26) - 1) {
25
-            $r = chr($n % 26 + 0x41).$r;
25
+            $r = chr($n % 26 + 0x41) . $r;
26 26
         }
27 27
         if ($absolute) {
28
-            return '$'.$r.'$'.($rowNumber + 1);
28
+            return '$' . $r . '$' . ($rowNumber + 1);
29 29
         }
30 30
 
31
-        return $r.($rowNumber + 1);
31
+        return $r . ($rowNumber + 1);
32 32
     }
33 33
 
34 34
     /**
@@ -82,7 +82,7 @@  discard block
 block discarded – undo
82 82
                 $ignoreUntil = '';
83 83
             }
84 84
             if ('' == $ignoreUntil && (' ' == $c || '-' == $c || '(' == $c || ')' == $c) && (0 == $i || '_' != $numFormat[$i - 1])) {
85
-                $escaped .= '\\'.$c;
85
+                $escaped .= '\\' . $c;
86 86
             } else {
87 87
                 $escaped .= $c;
88 88
             }
@@ -156,8 +156,8 @@  discard block
 block discarded – undo
156 156
      */
157 157
     public static function convertDateTime($dateInput)
158 158
     {
159
-        $seconds = 0;    // Time expressed as fraction of 24h hours in seconds
160
-        $year    = $month    = $day    = 0;
159
+        $seconds = 0; // Time expressed as fraction of 24h hours in seconds
160
+        $year    = $month = $day = 0;
161 161
 
162 162
         $date_time = $dateInput;
163 163
         if (preg_match("/(\d{4})\-(\d{2})\-(\d{2})/", $date_time, $matches)) {
@@ -202,13 +202,13 @@  discard block
 block discarded – undo
202 202
             return 0;
203 203
         }
204 204
         // Accumulate the number of days since the epoch.
205
-        $days = $day;    // Add days for current month
206
-        $days += array_sum(array_slice($mdays, 0, $month - 1));    // Add days for past months
207
-        $days += $range * 365;                      // Add days for past years
208
-        $days += intval(($range) / 4);             // Add leapdays
205
+        $days = $day; // Add days for current month
206
+        $days += array_sum(array_slice($mdays, 0, $month - 1)); // Add days for past months
207
+        $days += $range * 365; // Add days for past years
208
+        $days += intval(($range) / 4); // Add leapdays
209 209
         $days -= intval(($range + $offset) / 100); // Subtract 100 year leapdays
210
-        $days += intval(($range + $offset + $norm) / 400);  // Add 400 year leapdays
211
-        $days -= $leap;                                      // Already counted above
210
+        $days += intval(($range + $offset + $norm) / 400); // Add 400 year leapdays
211
+        $days -= $leap; // Already counted above
212 212
         // Adjust for Excel erroneously treating 1900 as a leap year.
213 213
         if ($days > 59) {
214 214
             ++$days;
@@ -225,6 +225,6 @@  discard block
 block discarded – undo
225 225
         $sheetname        = mb_substr($sheetname, 0, 31);
226 226
         $sheetname        = trim(trim(trim($sheetname), "'")); //trim before and after trimming single quotes
227 227
 
228
-        return !empty($sheetname) ? $sheetname : 'Sheet'.((rand() % 900) + 100);
228
+        return !empty($sheetname) ? $sheetname : 'Sheet' . ((rand() % 900) + 100);
229 229
     }
230 230
 }
Please login to merge, or discard this patch.
src/Writer/XlsxBuilder.php 1 patch
Spacing   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -46,7 +46,7 @@  discard block
 block discarded – undo
46 46
         $author   = Support::xmlSpecialChars($author);
47 47
         $keywords = Support::xmlSpecialChars(implode(',', $keywords));
48 48
         if ($keywords) {
49
-            $keywords = '<cp:keywords>'.$keywords.'</cp:keywords>';
49
+            $keywords = '<cp:keywords>' . $keywords . '</cp:keywords>';
50 50
         }
51 51
         $description = Support::xmlSpecialChars($description);
52 52
         $date        = date("Y-m-d\TH:i:s.00\Z");
@@ -67,7 +67,7 @@  discard block
 block discarded – undo
67 67
     public static function buildRelationshipsXML()
68 68
     {
69 69
         $relsXml = '';
70
-        $relsXml .= '<?xml version="1.0" encoding="UTF-8"?>'."\n";
70
+        $relsXml .= '<?xml version="1.0" encoding="UTF-8"?>' . "\n";
71 71
         $relsXml .= '<Relationships xmlns="http://schemas.openxmlformats.org/package/2006/relationships">';
72 72
         $relsXml .= '<Relationship Id="rId1" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/officeDocument" Target="xl/workbook.xml"/>';
73 73
         $relsXml .= '<Relationship Id="rId2" Type="http://schemas.openxmlformats.org/package/2006/relationships/metadata/core-properties" Target="docProps/core.xml"/>';
@@ -92,17 +92,17 @@  discard block
 block discarded – undo
92 92
 EOF;
93 93
         foreach ($sheets as $sheetName => $sheet) {
94 94
             $sheetname = Support::sanitizeSheetname($sheet->sheetname);
95
-            $workbookXml .= '<sheet name="'.Support::xmlSpecialChars($sheetname).
96
-                '" sheetId="'.($i + 1).'" state="visible" r:id="rId'.($i + 2).'"/>';
95
+            $workbookXml .= '<sheet name="' . Support::xmlSpecialChars($sheetname) .
96
+                '" sheetId="' . ($i + 1) . '" state="visible" r:id="rId' . ($i + 2) . '"/>';
97 97
             ++$i;
98 98
         }
99 99
         $workbookXml .= '</sheets><definedNames>';
100 100
         foreach ($sheets as $sheetName => $sheet) {
101 101
             if ($sheet->autoFilter) {
102 102
                 $sheetname = Support::sanitizeSheetname($sheet->sheetname);
103
-                $workbookXml .= '<definedName name="_xlnm._FilterDatabase" localSheetId="0" hidden="1">\''.
104
-                    Support::xmlSpecialChars($sheetname).'\'!$A$1:'.
105
-                    Support::xlsCell($sheet->rowCount - 1, count($sheet->columns) - 1, true).'</definedName>';
103
+                $workbookXml .= '<definedName name="_xlnm._FilterDatabase" localSheetId="0" hidden="1">\'' .
104
+                    Support::xmlSpecialChars($sheetname) . '\'!$A$1:' .
105
+                    Support::xlsCell($sheet->rowCount - 1, count($sheet->columns) - 1, true) . '</definedName>';
106 106
                 ++$i;
107 107
             }
108 108
         }
@@ -124,12 +124,12 @@  discard block
 block discarded – undo
124 124
 <Relationships xmlns="http://schemas.openxmlformats.org/package/2006/relationships"><Relationship Id="rId1" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/styles" Target="styles.xml"/>
125 125
 EOF;
126 126
         foreach ($sheets as $sheetName => $sheet) {
127
-            $wkbkrelsXml .= '<Relationship Id="rId'.($i + 2).
128
-                '" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/worksheet" Target="worksheets/'.
129
-                ($sheet->xmlname).'"/>';
127
+            $wkbkrelsXml .= '<Relationship Id="rId' . ($i + 2) .
128
+                '" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/worksheet" Target="worksheets/' .
129
+                ($sheet->xmlname) . '"/>';
130 130
             ++$i;
131 131
         }
132
-        $wkbkrelsXml .= "\n".'</Relationships>';
132
+        $wkbkrelsXml .= "\n" . '</Relationships>';
133 133
 
134 134
         return $wkbkrelsXml;
135 135
     }
@@ -142,12 +142,12 @@  discard block
 block discarded – undo
142 142
     public static function buildContentTypesXML(array $sheets)
143 143
     {
144 144
         $contentTypesXml = '';
145
-        $contentTypesXml .= '<?xml version="1.0" encoding="UTF-8"?>'."\n";
145
+        $contentTypesXml .= '<?xml version="1.0" encoding="UTF-8"?>' . "\n";
146 146
         $contentTypesXml .= '<Types xmlns="http://schemas.openxmlformats.org/package/2006/content-types">';
147 147
         $contentTypesXml .= '<Override PartName="/_rels/.rels" ContentType="application/vnd.openxmlformats-package.relationships+xml"/>';
148 148
         $contentTypesXml .= '<Override PartName="/xl/_rels/workbook.xml.rels" ContentType="application/vnd.openxmlformats-package.relationships+xml"/>';
149 149
         foreach ($sheets as $sheetName => $sheet) {
150
-            $contentTypesXml .= '<Override PartName="/xl/worksheets/'.($sheet->xmlname).'" ContentType="application/vnd.openxmlformats-officedocument.spreadsheetml.worksheet+xml"/>';
150
+            $contentTypesXml .= '<Override PartName="/xl/worksheets/' . ($sheet->xmlname) . '" ContentType="application/vnd.openxmlformats-officedocument.spreadsheetml.worksheet+xml"/>';
151 151
         }
152 152
         $contentTypesXml .= '<Override PartName="/xl/workbook.xml" ContentType="application/vnd.openxmlformats-officedocument.spreadsheetml.sheet.main+xml"/>';
153 153
         $contentTypesXml .= '<Override PartName="/xl/styles.xml" ContentType="application/vnd.openxmlformats-officedocument.spreadsheetml.styles+xml"/>';
Please login to merge, or discard this patch.
src/Writer/Style.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -56,7 +56,7 @@  discard block
 block discarded – undo
56 56
     protected function addCellStyle($numberFormat, $cellStyleString)
57 57
     {
58 58
         $numberFormatIdx = Support::add2listGetIndex($this->numberFormats, $numberFormat);
59
-        $lookupString    = $numberFormatIdx.';'.$cellStyleString;
59
+        $lookupString    = $numberFormatIdx . ';' . $cellStyleString;
60 60
 
61 61
         return Support::add2listGetIndex($this->cellStyles, $lookupString);
62 62
     }
@@ -80,15 +80,15 @@  discard block
 block discarded – undo
80 80
                 }
81 81
                 if (isset($style['border-color']) && is_string($style['border-color']) && '#' == $style['border-color'][0]) {
82 82
                     $v                     = substr($style['border-color'], 1, 6);
83
-                    $v                     = 3 == strlen($v) ? $v[0].$v[0].$v[1].$v[1].$v[2].$v[2] : $v; // expand cf0 => ccff00
84
-                    $border_value['color'] = 'FF'.strtoupper($v);
83
+                    $v                     = 3 == strlen($v) ? $v[0] . $v[0] . $v[1] . $v[1] . $v[2] . $v[2] : $v; // expand cf0 => ccff00
84
+                    $border_value['color'] = 'FF' . strtoupper($v);
85 85
                 }
86 86
                 $styleIndexes[$i]['border_idx'] = Support::add2listGetIndex($borders, json_encode($borderValue));
87 87
             }
88 88
             if (isset($style['fill']) && is_string($style['fill']) && '#' == $style['fill'][0]) {
89 89
                 $v                            = substr($style['fill'], 1, 6);
90
-                $v                            = 3 == strlen($v) ? $v[0].$v[0].$v[1].$v[1].$v[2].$v[2] : $v; // expand cf0 => ccff00
91
-                $styleIndexes[$i]['fill_idx'] = Support::add2listGetIndex($fills, 'FF'.strtoupper($v));
90
+                $v                            = 3 == strlen($v) ? $v[0] . $v[0] . $v[1] . $v[1] . $v[2] . $v[2] : $v; // expand cf0 => ccff00
91
+                $styleIndexes[$i]['fill_idx'] = Support::add2listGetIndex($fills, 'FF' . strtoupper($v));
92 92
             }
93 93
             if (isset($style['halign']) && in_array($style['halign'], $this->horizontalAllowed)) {
94 94
                 $styleIndexes[$i]['alignment'] = true;
@@ -100,7 +100,7 @@  discard block
 block discarded – undo
100 100
             }
101 101
             if (isset($style['wrap_text'])) {
102 102
                 $styleIndexes[$i]['alignment'] = true;
103
-                $styleIndexes[$i]['wrap_text'] = (bool) $style['wrap_text'];
103
+                $styleIndexes[$i]['wrap_text'] = (bool)$style['wrap_text'];
104 104
             }
105 105
 
106 106
             $font = $this->defaultFont;
@@ -135,8 +135,8 @@  discard block
 block discarded – undo
135 135
             }
136 136
             if (isset($style['color']) && is_string($style['color']) && '#' == $style['color'][0]) {
137 137
                 $v             = substr($style['color'], 1, 6);
138
-                $v             = 3 == strlen($v) ? $v[0].$v[0].$v[1].$v[1].$v[2].$v[2] : $v; // expand cf0 => ccff00
139
-                $font['color'] = 'FF'.strtoupper($v);
138
+                $v             = 3 == strlen($v) ? $v[0] . $v[0] . $v[1] . $v[1] . $v[2] . $v[2] : $v; // expand cf0 => ccff00
139
+                $font['color'] = 'FF' . strtoupper($v);
140 140
             }
141 141
             if ($font != $this->defaultFont) {
142 142
                 $styleIndexes[$i]['font_idx'] = Support::add2listGetIndex($fonts, json_encode($font));
Please login to merge, or discard this patch.
src/Writer/Builder.php 1 patch
Spacing   +4 added lines, -6 removed lines patch added patch discarded remove patch
@@ -184,7 +184,7 @@  discard block
 block discarded – undo
184 184
             $zip->addFile($sheet->filename, 'xl/worksheets/' . $sheet->xmlname);
185 185
         }
186 186
         $zip->addFromString('xl/workbook.xml', XlsxBuilder::buildWorkbookXML($this->sheets));
187
-        $zip->addFile($this->writeStylesXML(), 'xl/styles.xml');  //$zip->addFromString("xl/styles.xml", self::buildStylesXML() );
187
+        $zip->addFile($this->writeStylesXML(), 'xl/styles.xml'); //$zip->addFromString("xl/styles.xml", self::buildStylesXML() );
188 188
         $zip->addFromString('[Content_Types].xml', XlsxBuilder::buildContentTypesXML($this->sheets));
189 189
         $zip->addEmptyDir('xl/_rels/');
190 190
         $zip->addFromString('xl/_rels/workbook.xml.rels', XlsxBuilder::buildWorkbookRelsXML($this->sheets));
@@ -231,8 +231,7 @@  discard block
 block discarded – undo
231 231
         foreach ($row as $v) {
232 232
             $numberFormat     = $sheet->columns[$c]['number_format'];
233 233
             $numberFormatType = $sheet->columns[$c]['number_format_type'];
234
-            $cellStyleIdx     = empty($style) ? $sheet->columns[$c]['default_cell_style'] :
235
-                $this->addCellStyle($numberFormat, json_encode(isset($style[0]) ? $style[$c] : $style));
234
+            $cellStyleIdx     = empty($style) ? $sheet->columns[$c]['default_cell_style'] : $this->addCellStyle($numberFormat, json_encode(isset($style[0]) ? $style[$c] : $style));
236 235
             $sheet->writeCell($sheet->rowCount, $c, $v, $numberFormatType, $cellStyleIdx);
237 236
             ++$c;
238 237
         }
@@ -430,8 +429,7 @@  discard block
 block discarded – undo
430 429
             );
431 430
             foreach ($headerRow as $c => $v) {
432 431
                 $cellStyleIdx = empty($style) ?
433
-                    $sheet->columns[$c]['default_cell_style'] :
434
-                    $this->addCellStyle('GENERAL', json_encode(isset($style[0]) ? $style[$c] : $style));
432
+                    $sheet->columns[$c]['default_cell_style'] : $this->addCellStyle('GENERAL', json_encode(isset($style[0]) ? $style[$c] : $style));
435 433
                 $sheet->writeCell(0, $c, $v, 'n_string', $cellStyleIdx);
436 434
             }
437 435
             $writer->write('</row>');
@@ -445,7 +443,7 @@  discard block
 block discarded – undo
445 443
             $numberFormat = Support::numberFormatStandardized($v);
446 444
             $cellStyleIdx = $this->addCellStyle($numberFormat, $styleString = null);
447 445
             $columns[]    = [
448
-                'number_format'      => $numberFormat,      //contains excel format like 'YYYY-MM-DD HH:MM:SS'
446
+                'number_format'      => $numberFormat, //contains excel format like 'YYYY-MM-DD HH:MM:SS'
449 447
                 'number_format_type' => Support::determineNumberFormatType($numberFormat), //contains friendly format like 'datetime'
450 448
                 'default_cell_style' => $cellStyleIdx,
451 449
             ];
Please login to merge, or discard this patch.
src/Writer/Sheet.php 1 patch
Spacing   +40 added lines, -40 removed lines patch added patch discarded remove patch
@@ -63,39 +63,39 @@  discard block
 block discarded – undo
63 63
         $cellName = Support::xlsCell($rowNumber, $columnNumber);
64 64
         $file     = $this->getFileWriter();
65 65
         if (!is_scalar($value) || '' === $value) { //objects, array, empty
66
-            $file->write('<c r="'.$cellName.'" s="'.$cellStyleIdx.'"/>');
66
+            $file->write('<c r="' . $cellName . '" s="' . $cellStyleIdx . '"/>');
67 67
         } elseif (is_string($value) && '=' == $value[0]) {
68
-            $file->write('<c r="'.$cellName.'" s="'.$cellStyleIdx.'" t="s"><f>'.Support::xmlSpecialChars($value).'</f></c>');
68
+            $file->write('<c r="' . $cellName . '" s="' . $cellStyleIdx . '" t="s"><f>' . Support::xmlSpecialChars($value) . '</f></c>');
69 69
         } else {
70 70
             switch ($numFormatType) {
71 71
                 case 'n_date':
72
-                    $file->write('<c r="'.$cellName.'" s="'.$cellStyleIdx.'" t="n"><v>'.
73
-                        intval(Support::convertDateTime($value)).'</v></c>');
72
+                    $file->write('<c r="' . $cellName . '" s="' . $cellStyleIdx . '" t="n"><v>' .
73
+                        intval(Support::convertDateTime($value)) . '</v></c>');
74 74
                     break;
75 75
                 case 'n_datetime':
76
-                    $file->write('<c r="'.$cellName.'" s="'.$cellStyleIdx.'" t="n"><v>'.
77
-                        Support::convertDateTime($value).'</v></c>');
76
+                    $file->write('<c r="' . $cellName . '" s="' . $cellStyleIdx . '" t="n"><v>' .
77
+                        Support::convertDateTime($value) . '</v></c>');
78 78
                     break;
79 79
                 case 'n_numeric':
80
-                    $file->write('<c r="'.$cellName.'" s="'.$cellStyleIdx.'" t="n"><v>'.
81
-                        Support::xmlSpecialChars($value).'</v></c>'); //int,float,currency
80
+                    $file->write('<c r="' . $cellName . '" s="' . $cellStyleIdx . '" t="n"><v>' .
81
+                        Support::xmlSpecialChars($value) . '</v></c>'); //int,float,currency
82 82
                     break;
83 83
                 case 'n_string':
84
-                    $file->write('<c r="'.$cellName.'" s="'.$cellStyleIdx.'" t="inlineStr"><is><t>'.
85
-                        Support::xmlSpecialChars($value).'</t></is></c>');
84
+                    $file->write('<c r="' . $cellName . '" s="' . $cellStyleIdx . '" t="inlineStr"><is><t>' .
85
+                        Support::xmlSpecialChars($value) . '</t></is></c>');
86 86
                     break;
87 87
                 case 'n_auto':
88 88
                 default: //auto-detect unknown column types
89 89
                     if (!is_string($value) || '0' == $value || ('0' != $value[0] && ctype_digit($value)) || preg_match("/^\-?(0|[1-9][0-9]*)(\.[0-9]+)?$/", $value)
90 90
                     ) { //int,float,currency
91 91
                         $file->write(
92
-                            '<c r="'.$cellName.'" s="'.$cellStyleIdx.'" t="n"><v>'.
93
-                            Support::xmlSpecialChars($value).'</v></c>'
92
+                            '<c r="' . $cellName . '" s="' . $cellStyleIdx . '" t="n"><v>' .
93
+                            Support::xmlSpecialChars($value) . '</v></c>'
94 94
                         );
95 95
                     } else { //implied: ($cell_format=='string')
96 96
                         $file->write(
97
-                            '<c r="'.$cellName.'" s="'.$cellStyleIdx.'" t="inlineStr"><is><t>'.
98
-                            Support::xmlSpecialChars($value).'</t></is></c>'
97
+                            '<c r="' . $cellName . '" s="' . $cellStyleIdx . '" t="inlineStr"><is><t>' .
98
+                            Support::xmlSpecialChars($value) . '</t></is></c>'
99 99
                         );
100 100
                     }
101 101
                     break;
@@ -112,14 +112,14 @@  discard block
 block discarded – undo
112 112
         $writer      = $this->getFileWriter();
113 113
         $tabSelected = $isTabSelected ? 'true' : 'false';
114 114
         $maxCell     = Support::xlsCell(XlsxWriter::EXCEL_2007_MAX_ROW, XlsxWriter::EXCEL_2007_MAX_COL); //XFE1048577
115
-        $writer->write('<?xml version="1.0" encoding="UTF-8" standalone="yes"?>'."\n");
115
+        $writer->write('<?xml version="1.0" encoding="UTF-8" standalone="yes"?>' . "\n");
116 116
         $writer->write(
117 117
             <<<EOF
118 118
 <worksheet xmlns="http://schemas.openxmlformats.org/spreadsheetml/2006/main" xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships"><sheetPr filterMode="false"><pageSetUpPr fitToPage="false"/></sheetPr>
119 119
 EOF
120 120
         );
121 121
         $this->maxCellTagStart = $this->fileWriter->ftell();
122
-        $writer->write('<dimension ref="A1:'.$maxCell.'"/>');
122
+        $writer->write('<dimension ref="A1:' . $maxCell . '"/>');
123 123
         $this->maxCellTagEnd = $this->fileWriter->ftell();
124 124
         $writer->write('<sheetViews>');
125 125
         $writer->write(
@@ -141,15 +141,15 @@  discard block
 block discarded – undo
141 141
         if (!empty($colWidths)) {
142 142
             foreach ($colWidths as $colWidth) {
143 143
                 $writer->write(
144
-                    '<col collapsed="false" hidden="false" max="'.($i + 1).'" min="'.($i + 1).
145
-                    '" style="0" customWidth="true" width="'.floatval($colWidth).'"/>'
144
+                    '<col collapsed="false" hidden="false" max="' . ($i + 1) . '" min="' . ($i + 1) .
145
+                    '" style="0" customWidth="true" width="' . floatval($colWidth) . '"/>'
146 146
                 );
147 147
                 ++$i;
148 148
             }
149 149
         }
150 150
         $writer->write(
151
-            '<col collapsed="false" hidden="false" max="1024" min="'.($i + 1).
152
-            '" style="0" customWidth="false" width="11.5"/>'.'</cols><sheetData>'
151
+            '<col collapsed="false" hidden="false" max="1024" min="' . ($i + 1) .
152
+            '" style="0" customWidth="false" width="11.5"/>' . '</cols><sheetData>'
153 153
         );
154 154
     }
155 155
 
@@ -160,7 +160,7 @@  discard block
 block discarded – undo
160 160
         if (!empty($this->merge_cells)) {
161 161
             $this->fileWriter->write('<mergeCells>');
162 162
             foreach ($this->mergeCells as $range) {
163
-                $this->fileWriter->write('<mergeCell ref="'.$range.'"/>');
163
+                $this->fileWriter->write('<mergeCell ref="' . $range . '"/>');
164 164
             }
165 165
             $this->fileWriter->write('</mergeCells>');
166 166
         }
@@ -168,7 +168,7 @@  discard block
 block discarded – undo
168 168
         $max_cell = Support::xlsCell($this->rowCount - 1, count($this->columns) - 1);
169 169
 
170 170
         if ($this->autoFilter) {
171
-            $this->fileWriter->write('<autoFilter ref="A1:'.$max_cell.'"/>');
171
+            $this->fileWriter->write('<autoFilter ref="A1:' . $max_cell . '"/>');
172 172
         }
173 173
 
174 174
         $this->fileWriter->write('<printOptions headings="false" gridLines="false" gridLinesSet="true" horizontalCentered="false" verticalCentered="false"/>');
@@ -180,10 +180,10 @@  discard block
 block discarded – undo
180 180
         $this->fileWriter->write('</headerFooter>');
181 181
         $this->fileWriter->write('</worksheet>');
182 182
 
183
-        $max_cell_tag   = '<dimension ref="A1:'.$max_cell.'"/>';
183
+        $max_cell_tag   = '<dimension ref="A1:' . $max_cell . '"/>';
184 184
         $padding_length = $this->maxCellTagEnd - $this->maxCellTagStart - strlen($max_cell_tag);
185 185
         $this->fileWriter->fseek($this->maxCellTagStart);
186
-        $this->fileWriter->write($max_cell_tag.str_repeat(' ', $padding_length));
186
+        $this->fileWriter->write($max_cell_tag . str_repeat(' ', $padding_length));
187 187
         $this->fileWriter->close();
188 188
         $this->finalized = true;
189 189
     }
@@ -192,14 +192,14 @@  discard block
 block discarded – undo
192 192
     {
193 193
         $writer = $this->getFileWriter();
194 194
         $writer->write(
195
-            '<pane ySplit="'.$this->freezeRows.'" xSplit="'.$this->freezeColumns.
196
-            '" topLeftCell="'.Support::xlsCell($this->freezeRows, $this->freezeColumns).
197
-            '" activePane="bottomRight" state="frozen"/>'.'<selection activeCell="'.Support::xlsCell($this->freezeRows, 0).
198
-            '" activeCellId="0" pane="topRight" sqref="'.Support::xlsCell($this->freezeRows, 0).'"/>'.
199
-            '<selection activeCell="'.Support::xlsCell(0, $this->freezeColumns).
200
-            '" activeCellId="0" pane="bottomLeft" sqref="'.Support::xlsCell(0, $this->freezeColumns).'"/>'.
201
-            '<selection activeCell="'.Support::xlsCell($this->freezeRows, $this->freezeColumns).
202
-            '" activeCellId="0" pane="bottomRight" sqref="'.Support::xlsCell($this->freezeRows, $this->freezeColumns).'"/>'
195
+            '<pane ySplit="' . $this->freezeRows . '" xSplit="' . $this->freezeColumns .
196
+            '" topLeftCell="' . Support::xlsCell($this->freezeRows, $this->freezeColumns) .
197
+            '" activePane="bottomRight" state="frozen"/>' . '<selection activeCell="' . Support::xlsCell($this->freezeRows, 0) .
198
+            '" activeCellId="0" pane="topRight" sqref="' . Support::xlsCell($this->freezeRows, 0) . '"/>' .
199
+            '<selection activeCell="' . Support::xlsCell(0, $this->freezeColumns) .
200
+            '" activeCellId="0" pane="bottomLeft" sqref="' . Support::xlsCell(0, $this->freezeColumns) . '"/>' .
201
+            '<selection activeCell="' . Support::xlsCell($this->freezeRows, $this->freezeColumns) .
202
+            '" activeCellId="0" pane="bottomRight" sqref="' . Support::xlsCell($this->freezeRows, $this->freezeColumns) . '"/>'
203 203
         );
204 204
     }
205 205
 
@@ -207,10 +207,10 @@  discard block
 block discarded – undo
207 207
     {
208 208
         $writer = $this->getFileWriter();
209 209
         $writer->write(
210
-            '<pane ySplit="'.$this->freezeRows.'" topLeftCell="'.
211
-            Support::xlsCell($this->freezeRows, 0).'" activePane="bottomLeft" state="frozen"/>'.
212
-            '<selection activeCell="'.Support::xlsCell($this->freezeRows, 0).
213
-            '" activeCellId="0" pane="bottomLeft" sqref="'.Support::xlsCell($this->freezeRows, 0).'"/>'
210
+            '<pane ySplit="' . $this->freezeRows . '" topLeftCell="' .
211
+            Support::xlsCell($this->freezeRows, 0) . '" activePane="bottomLeft" state="frozen"/>' .
212
+            '<selection activeCell="' . Support::xlsCell($this->freezeRows, 0) .
213
+            '" activeCellId="0" pane="bottomLeft" sqref="' . Support::xlsCell($this->freezeRows, 0) . '"/>'
214 214
         );
215 215
     }
216 216
 
@@ -218,10 +218,10 @@  discard block
 block discarded – undo
218 218
     {
219 219
         $writer = $this->getFileWriter();
220 220
         $writer->write(
221
-            '<pane xSplit="'.$this->freezeColumns.'" topLeftCell="'.
222
-            Support::xlsCell(0, $this->freezeColumns).'" activePane="topRight" state="frozen"/>'.
223
-            '<selection activeCell="'.Support::xlsCell(0, $this->freezeColumns).
224
-            '" activeCellId="0" pane="topRight" sqref="'.Support::xlsCell(0, $this->freezeColumns).'"/>'
221
+            '<pane xSplit="' . $this->freezeColumns . '" topLeftCell="' .
222
+            Support::xlsCell(0, $this->freezeColumns) . '" activePane="topRight" state="frozen"/>' .
223
+            '<selection activeCell="' . Support::xlsCell(0, $this->freezeColumns) .
224
+            '" activeCellId="0" pane="topRight" sqref="' . Support::xlsCell(0, $this->freezeColumns) . '"/>'
225 225
         );
226 226
     }
227 227
 
Please login to merge, or discard this patch.