Completed
Push — master ( c4b8f0...641d62 )
by Once
02:12
created
src/Writer/Sheet.php 1 patch
Spacing   +41 added lines, -41 removed lines patch added patch discarded remove patch
@@ -64,35 +64,35 @@  discard block
 block discarded – undo
64 64
         $file = $this->getFileWriter();
65 65
 
66 66
         if (!is_scalar($value) || '' === $value) { //objects, array, empty
67
-            $file->write('<c r="'.$cellName.'" s="'.$cellStyleIdx.'"/>');
67
+            $file->write('<c r="' . $cellName . '" s="' . $cellStyleIdx . '"/>');
68 68
         } elseif (is_string($value) && '=' == $value[0]) {
69 69
             // Support Formula
70 70
             if ('n_function' === $numFormatType) {
71
-                $file->write('<c r="'.$cellName.'" s="'.$cellStyleIdx.'" t="s"><f>'.
71
+                $file->write('<c r="' . $cellName . '" s="' . $cellStyleIdx . '" t="s"><f>' .
72 72
                     str_replace('{n}', $rowNumber + 1, substr(Support::xmlSpecialChars($value), 1))
73 73
                     .'</f></c>');
74 74
             } else {
75
-                $file->write('<c r="'.$cellName.'" s="'.$cellStyleIdx.'" t="s"><f>'.Support::xmlSpecialChars($value).'</f></c>');
75
+                $file->write('<c r="' . $cellName . '" s="' . $cellStyleIdx . '" t="s"><f>' . Support::xmlSpecialChars($value) . '</f></c>');
76 76
             }
77 77
         } else {
78 78
             switch ($numFormatType) {
79 79
                 case 'n_date':
80
-                    $file->write('<c r="'.$cellName.'" s="'.$cellStyleIdx.'" t="n"><v>'.
81
-                        intval(Support::convertDateTime($value)).'</v></c>');
80
+                    $file->write('<c r="' . $cellName . '" s="' . $cellStyleIdx . '" t="n"><v>' .
81
+                        intval(Support::convertDateTime($value)) . '</v></c>');
82 82
 
83 83
                     break;
84 84
                 case 'n_datetime':
85
-                    $file->write('<c r="'.$cellName.'" s="'.$cellStyleIdx.'" t="n"><v>'.
86
-                        Support::convertDateTime($value).'</v></c>');
85
+                    $file->write('<c r="' . $cellName . '" s="' . $cellStyleIdx . '" t="n"><v>' .
86
+                        Support::convertDateTime($value) . '</v></c>');
87 87
 
88 88
                     break;
89 89
                 case 'n_numeric':
90
-                    $file->write('<c r="'.$cellName.'" s="'.$cellStyleIdx.'" t="n"><v>'.
91
-                        Support::xmlSpecialChars($value).'</v></c>'); //int,float,currency
90
+                    $file->write('<c r="' . $cellName . '" s="' . $cellStyleIdx . '" t="n"><v>' .
91
+                        Support::xmlSpecialChars($value) . '</v></c>'); //int,float,currency
92 92
                     break;
93 93
                 case 'n_string':
94
-                    $file->write('<c r="'.$cellName.'" s="'.$cellStyleIdx.'" t="inlineStr"><is><t>'.
95
-                        Support::xmlSpecialChars($value).'</t></is></c>');
94
+                    $file->write('<c r="' . $cellName . '" s="' . $cellStyleIdx . '" t="inlineStr"><is><t>' .
95
+                        Support::xmlSpecialChars($value) . '</t></is></c>');
96 96
 
97 97
                     break;
98 98
                 case 'n_auto':
@@ -100,13 +100,13 @@  discard block
 block discarded – undo
100 100
                     if (!is_string($value) || '0' == $value || ('0' != $value[0] && ctype_digit($value)) || preg_match("/^\-?(0|[1-9][0-9]*)(\.[0-9]+)?$/", $value)
101 101
                     ) { //int,float,currency
102 102
                         $file->write(
103
-                            '<c r="'.$cellName.'" s="'.$cellStyleIdx.'" t="n"><v>'.
104
-                            Support::xmlSpecialChars($value).'</v></c>'
103
+                            '<c r="' . $cellName . '" s="' . $cellStyleIdx . '" t="n"><v>' .
104
+                            Support::xmlSpecialChars($value) . '</v></c>'
105 105
                         );
106 106
                     } else { //implied: ($cell_format=='string')
107 107
                         $file->write(
108
-                            '<c r="'.$cellName.'" s="'.$cellStyleIdx.'" t="inlineStr"><is><t>'.
109
-                            Support::xmlSpecialChars($value).'</t></is></c>'
108
+                            '<c r="' . $cellName . '" s="' . $cellStyleIdx . '" t="inlineStr"><is><t>' .
109
+                            Support::xmlSpecialChars($value) . '</t></is></c>'
110 110
                         );
111 111
                     }
112 112
 
@@ -124,14 +124,14 @@  discard block
 block discarded – undo
124 124
         $writer = $this->getFileWriter();
125 125
         $tabSelected = $isTabSelected ? 'true' : 'false';
126 126
         $maxCell = Support::xlsCell(Builder::EXCEL_2007_MAX_ROW, Builder::EXCEL_2007_MAX_COL); //XFE1048577
127
-        $writer->write('<?xml version="1.0" encoding="UTF-8" standalone="yes"?>'."\n");
127
+        $writer->write('<?xml version="1.0" encoding="UTF-8" standalone="yes"?>' . "\n");
128 128
         $writer->write(
129 129
             <<<'EOF'
130 130
 <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>
131 131
 EOF
132 132
         );
133 133
         $this->maxCellTagStart = $this->fileWriter->ftell();
134
-        $writer->write('<dimension ref="A1:'.$maxCell.'"/>');
134
+        $writer->write('<dimension ref="A1:' . $maxCell . '"/>');
135 135
         $this->maxCellTagEnd = $this->fileWriter->ftell();
136 136
         $writer->write('<sheetViews>');
137 137
         $writer->write(
@@ -153,15 +153,15 @@  discard block
 block discarded – undo
153 153
         if (!empty($colWidths)) {
154 154
             foreach ($colWidths as $colWidth) {
155 155
                 $writer->write(
156
-                    '<col collapsed="false" hidden="false" max="'.($i + 1).'" min="'.($i + 1).
157
-                    '" style="0" customWidth="true" width="'.floatval($colWidth).'"/>'
156
+                    '<col collapsed="false" hidden="false" max="' . ($i + 1) . '" min="' . ($i + 1) .
157
+                    '" style="0" customWidth="true" width="' . floatval($colWidth) . '"/>'
158 158
                 );
159 159
                 ++$i;
160 160
             }
161 161
         }
162 162
         $writer->write(
163
-            '<col collapsed="false" hidden="false" max="1024" min="'.($i + 1).
164
-            '" style="0" customWidth="false" width="11.5"/>'.'</cols><sheetData>'
163
+            '<col collapsed="false" hidden="false" max="1024" min="' . ($i + 1) .
164
+            '" style="0" customWidth="false" width="11.5"/>' . '</cols><sheetData>'
165 165
         );
166 166
     }
167 167
 
@@ -172,7 +172,7 @@  discard block
 block discarded – undo
172 172
         if (!empty($this->mergeCells)) {
173 173
             $this->fileWriter->write('<mergeCells>');
174 174
             foreach ($this->mergeCells as $range) {
175
-                $this->fileWriter->write('<mergeCell ref="'.$range.'"/>');
175
+                $this->fileWriter->write('<mergeCell ref="' . $range . '"/>');
176 176
             }
177 177
             $this->fileWriter->write('</mergeCells>');
178 178
         }
@@ -180,7 +180,7 @@  discard block
 block discarded – undo
180 180
         $maxCell = Support::xlsCell($this->rowCount - 1, count($this->columns) - 1);
181 181
 
182 182
         if ($this->autoFilter) {
183
-            $this->fileWriter->write('<autoFilter ref="A1:'.$maxCell.'"/>');
183
+            $this->fileWriter->write('<autoFilter ref="A1:' . $maxCell . '"/>');
184 184
         }
185 185
 
186 186
         $this->fileWriter->write('<printOptions headings="false" gridLines="false" gridLinesSet="true" horizontalCentered="false" verticalCentered="false"/>');
@@ -192,10 +192,10 @@  discard block
 block discarded – undo
192 192
         $this->fileWriter->write('</headerFooter>');
193 193
         $this->fileWriter->write('</worksheet>');
194 194
 
195
-        $maxCellTag = '<dimension ref="A1:'.$maxCell.'"/>';
195
+        $maxCellTag = '<dimension ref="A1:' . $maxCell . '"/>';
196 196
         $paddingLength = $this->maxCellTagEnd - $this->maxCellTagStart - strlen($maxCellTag);
197 197
         $this->fileWriter->fseek($this->maxCellTagStart);
198
-        $this->fileWriter->write($maxCellTag.str_repeat(' ', $paddingLength));
198
+        $this->fileWriter->write($maxCellTag . str_repeat(' ', $paddingLength));
199 199
         $this->fileWriter->close();
200 200
         $this->finalized = true;
201 201
     }
@@ -204,14 +204,14 @@  discard block
 block discarded – undo
204 204
     {
205 205
         $writer = $this->getFileWriter();
206 206
         $writer->write(
207
-            '<pane ySplit="'.$this->freezeRows.'" xSplit="'.$this->freezeColumns.
208
-            '" topLeftCell="'.Support::xlsCell($this->freezeRows, $this->freezeColumns).
209
-            '" activePane="bottomRight" state="frozen"/>'.'<selection activeCell="'.Support::xlsCell($this->freezeRows, 0).
210
-            '" activeCellId="0" pane="topRight" sqref="'.Support::xlsCell($this->freezeRows, 0).'"/>'.
211
-            '<selection activeCell="'.Support::xlsCell(0, $this->freezeColumns).
212
-            '" activeCellId="0" pane="bottomLeft" sqref="'.Support::xlsCell(0, $this->freezeColumns).'"/>'.
213
-            '<selection activeCell="'.Support::xlsCell($this->freezeRows, $this->freezeColumns).
214
-            '" activeCellId="0" pane="bottomRight" sqref="'.Support::xlsCell($this->freezeRows, $this->freezeColumns).'"/>'
207
+            '<pane ySplit="' . $this->freezeRows . '" xSplit="' . $this->freezeColumns .
208
+            '" topLeftCell="' . Support::xlsCell($this->freezeRows, $this->freezeColumns) .
209
+            '" activePane="bottomRight" state="frozen"/>' . '<selection activeCell="' . Support::xlsCell($this->freezeRows, 0) .
210
+            '" activeCellId="0" pane="topRight" sqref="' . Support::xlsCell($this->freezeRows, 0) . '"/>' .
211
+            '<selection activeCell="' . Support::xlsCell(0, $this->freezeColumns) .
212
+            '" activeCellId="0" pane="bottomLeft" sqref="' . Support::xlsCell(0, $this->freezeColumns) . '"/>' .
213
+            '<selection activeCell="' . Support::xlsCell($this->freezeRows, $this->freezeColumns) .
214
+            '" activeCellId="0" pane="bottomRight" sqref="' . Support::xlsCell($this->freezeRows, $this->freezeColumns) . '"/>'
215 215
         );
216 216
     }
217 217
 
@@ -219,10 +219,10 @@  discard block
 block discarded – undo
219 219
     {
220 220
         $writer = $this->getFileWriter();
221 221
         $writer->write(
222
-            '<pane ySplit="'.$this->freezeRows.'" topLeftCell="'.
223
-            Support::xlsCell($this->freezeRows, 0).'" activePane="bottomLeft" state="frozen"/>'.
224
-            '<selection activeCell="'.Support::xlsCell($this->freezeRows, 0).
225
-            '" activeCellId="0" pane="bottomLeft" sqref="'.Support::xlsCell($this->freezeRows, 0).'"/>'
222
+            '<pane ySplit="' . $this->freezeRows . '" topLeftCell="' .
223
+            Support::xlsCell($this->freezeRows, 0) . '" activePane="bottomLeft" state="frozen"/>' .
224
+            '<selection activeCell="' . Support::xlsCell($this->freezeRows, 0) .
225
+            '" activeCellId="0" pane="bottomLeft" sqref="' . Support::xlsCell($this->freezeRows, 0) . '"/>'
226 226
         );
227 227
     }
228 228
 
@@ -230,10 +230,10 @@  discard block
 block discarded – undo
230 230
     {
231 231
         $writer = $this->getFileWriter();
232 232
         $writer->write(
233
-            '<pane xSplit="'.$this->freezeColumns.'" topLeftCell="'.
234
-            Support::xlsCell(0, $this->freezeColumns).'" activePane="topRight" state="frozen"/>'.
235
-            '<selection activeCell="'.Support::xlsCell(0, $this->freezeColumns).
236
-            '" activeCellId="0" pane="topRight" sqref="'.Support::xlsCell(0, $this->freezeColumns).'"/>'
233
+            '<pane xSplit="' . $this->freezeColumns . '" topLeftCell="' .
234
+            Support::xlsCell(0, $this->freezeColumns) . '" activePane="topRight" state="frozen"/>' .
235
+            '<selection activeCell="' . Support::xlsCell(0, $this->freezeColumns) .
236
+            '" activeCellId="0" pane="topRight" sqref="' . Support::xlsCell(0, $this->freezeColumns) . '"/>'
237 237
         );
238 238
     }
239 239
 
Please login to merge, or discard this patch.