@@ -219,8 +219,8 @@ |
||
219 | 219 | } |
220 | 220 | $spreadsheet->setActiveSheetIndex($this->sheetIndex); |
221 | 221 | |
222 | - $fromFormats = ['\-', '\ ']; |
|
223 | - $toFormats = ['-', ' ']; |
|
222 | + $fromFormats = ['\-', '\ ']; |
|
223 | + $toFormats = ['-', ' ']; |
|
224 | 224 | |
225 | 225 | // Loop through file |
226 | 226 | $rowData = []; |
@@ -626,10 +626,10 @@ |
||
626 | 626 | foreach ($temp as &$value) { |
627 | 627 | // Only replace in alternate array entries (i.e. non-quoted blocks) |
628 | 628 | if ($tKey = !$tKey) { |
629 | - $value = preg_replace('/\[([^\.]+)\.([^\.]+):\.([^\.]+)\]/Ui', '$1!$2:$3', $value); // Cell range reference in another sheet |
|
630 | - $value = preg_replace('/\[([^\.]+)\.([^\.]+)\]/Ui', '$1!$2', $value); // Cell reference in another sheet |
|
631 | - $value = preg_replace('/\[\.([^\.]+):\.([^\.]+)\]/Ui', '$1:$2', $value); // Cell range reference |
|
632 | - $value = preg_replace('/\[\.([^\.]+)\]/Ui', '$1', $value); // Simple cell reference |
|
629 | + $value = preg_replace('/\[([^\.]+)\.([^\.]+):\.([^\.]+)\]/Ui', '$1!$2:$3', $value); // Cell range reference in another sheet |
|
630 | + $value = preg_replace('/\[([^\.]+)\.([^\.]+)\]/Ui', '$1!$2', $value); // Cell reference in another sheet |
|
631 | + $value = preg_replace('/\[\.([^\.]+):\.([^\.]+)\]/Ui', '$1:$2', $value); // Cell range reference |
|
632 | + $value = preg_replace('/\[\.([^\.]+)\]/Ui', '$1', $value); // Simple cell reference |
|
633 | 633 | $value = \PhpSpreadsheet\Calculation::translateSeparator(';', ',', $value, $inBraces); |
634 | 634 | } |
635 | 635 | } |
@@ -29,8 +29,8 @@ |
||
29 | 29 | class Date |
30 | 30 | { |
31 | 31 | /** constants */ |
32 | - const CALENDAR_WINDOWS_1900 = 1900; // Base date of 1st Jan 1900 = 1.0 |
|
33 | - const CALENDAR_MAC_1904 = 1904; // Base date of 2nd Jan 1904 = 1.0 |
|
32 | + const CALENDAR_WINDOWS_1900 = 1900; // Base date of 1st Jan 1900 = 1.0 |
|
33 | + const CALENDAR_MAC_1904 = 1904; // Base date of 2nd Jan 1904 = 1.0 |
|
34 | 34 | |
35 | 35 | /* |
36 | 36 | * Names of the months of the year, indexed by shortname |
@@ -164,7 +164,7 @@ discard block |
||
164 | 164 | /** |
165 | 165 | * Convert a MS serialized datetime value from Excel to a PHP Date/Time object |
166 | 166 | * |
167 | - * @param int|float $excelTimestamp MS Excel serialized date/time value |
|
167 | + * @param integer $excelTimestamp MS Excel serialized date/time value |
|
168 | 168 | * @param \DateTimeZone|string|null $timeZone The timezone to assume for the Excel timestamp, |
169 | 169 | * if you don't want to treat it as a UTC value |
170 | 170 | * Use the default (UST) unless you absolutely need a conversion |
@@ -203,7 +203,7 @@ discard block |
||
203 | 203 | /** |
204 | 204 | * Convert a MS serialized datetime value from Excel to a unix timestamp |
205 | 205 | * |
206 | - * @param int|float $excelTimestamp MS Excel serialized date/time value |
|
206 | + * @param integer $excelTimestamp MS Excel serialized date/time value |
|
207 | 207 | * @param \DateTimeZone|string|null $timeZone The timezone to assume for the Excel timestamp, |
208 | 208 | * if you don't want to treat it as a UTC value |
209 | 209 | * Use the default (UST) unless you absolutely need a conversion |
@@ -219,7 +219,7 @@ discard block |
||
219 | 219 | /** |
220 | 220 | * Convert a date from PHP to an MS Excel serialized date/time value |
221 | 221 | * |
222 | - * @param mixed $dateValue Unix Timestamp or PHP DateTime object or a string |
|
222 | + * @param integer $dateValue Unix Timestamp or PHP DateTime object or a string |
|
223 | 223 | * @return float|bool Excel date/time value |
224 | 224 | * or boolean FALSE on failure |
225 | 225 | */ |
@@ -257,7 +257,7 @@ discard block |
||
257 | 257 | /** |
258 | 258 | * Convert a Unix timestamp to an MS Excel serialized date/time value |
259 | 259 | * |
260 | - * @param \DateTimeInterface $dateValue Unix Timestamp |
|
260 | + * @param integer $dateValue Unix Timestamp |
|
261 | 261 | * @return float MS Excel serialized date/time value |
262 | 262 | */ |
263 | 263 | public static function timestampToExcel($dateValue = 0) |
@@ -278,7 +278,7 @@ discard block |
||
278 | 278 | * @param int $hours |
279 | 279 | * @param int $minutes |
280 | 280 | * @param int $seconds |
281 | - * @return int Excel date/time value |
|
281 | + * @return double Excel date/time value |
|
282 | 282 | */ |
283 | 283 | public static function formattedPHPToExcel($year, $month, $day, $hours = 0, $minutes = 0, $seconds = 0) |
284 | 284 | { |
@@ -233,8 +233,8 @@ |
||
233 | 233 | $y1 = $offsetY; |
234 | 234 | |
235 | 235 | // Initialise end cell to the same as the start cell |
236 | - $col_end = $col_start; // Col containing lower right corner of object |
|
237 | - $row_end = $row_start; // Row containing bottom right corner of object |
|
236 | + $col_end = $col_start; // Col containing lower right corner of object |
|
237 | + $row_end = $row_start; // Row containing bottom right corner of object |
|
238 | 238 | |
239 | 239 | // Zero the specified offset if greater than the cell dimensions |
240 | 240 | if ($x1 >= self::sizeCol($sheet, \PhpSpreadsheet\Cell::stringFromColumnIndex($col_start))) { |
@@ -41,14 +41,14 @@ |
||
41 | 41 | public static function hashPassword($pPassword = '') |
42 | 42 | { |
43 | 43 | $password = 0x0000; |
44 | - $charPos = 1; // char position |
|
44 | + $charPos = 1; // char position |
|
45 | 45 | |
46 | 46 | // split the plain text password in its component characters |
47 | 47 | $chars = preg_split('//', $pPassword, -1, PREG_SPLIT_NO_EMPTY); |
48 | 48 | foreach ($chars as $char) { |
49 | - $value = ord($char) << $charPos++; // shifted ASCII value |
|
50 | - $rotated_bits = $value >> 15; // rotated bits beyond bit 15 |
|
51 | - $value &= 0x7fff; // first 15 bits |
|
49 | + $value = ord($char) << $charPos++; // shifted ASCII value |
|
50 | + $rotated_bits = $value >> 15; // rotated bits beyond bit 15 |
|
51 | + $value &= 0x7fff; // first 15 bits |
|
52 | 52 | $password ^= ($value | $rotated_bits); |
53 | 53 | } |
54 | 54 |
@@ -170,21 +170,21 @@ |
||
170 | 170 | $ret = str_pad($this->Name, 64, "\x00"); |
171 | 171 | |
172 | 172 | $ret .= pack('v', strlen($this->Name) + 2) // 66 |
173 | - . pack('c', $this->Type) // 67 |
|
174 | - . pack('c', 0x00) //UK // 68 |
|
175 | - . pack('V', $this->PrevPps) //Prev // 72 |
|
176 | - . pack('V', $this->NextPps) //Next // 76 |
|
177 | - . pack('V', $this->DirPps) //Dir // 80 |
|
178 | - . "\x00\x09\x02\x00" // 84 |
|
179 | - . "\x00\x00\x00\x00" // 88 |
|
180 | - . "\xc0\x00\x00\x00" // 92 |
|
181 | - . "\x00\x00\x00\x46" // 96 // Seems to be ok only for Root |
|
182 | - . "\x00\x00\x00\x00" // 100 |
|
183 | - . \PhpSpreadsheet\Shared\OLE::localDateToOLE($this->Time1st) // 108 |
|
184 | - . \PhpSpreadsheet\Shared\OLE::localDateToOLE($this->Time2nd) // 116 |
|
185 | - . pack('V', isset($this->startBlock) ? $this->startBlock : 0) // 120 |
|
186 | - . pack('V', $this->Size) // 124 |
|
187 | - . pack('V', 0); // 128 |
|
173 | + . pack('c', $this->Type) // 67 |
|
174 | + . pack('c', 0x00) //UK // 68 |
|
175 | + . pack('V', $this->PrevPps) //Prev // 72 |
|
176 | + . pack('V', $this->NextPps) //Next // 76 |
|
177 | + . pack('V', $this->DirPps) //Dir // 80 |
|
178 | + . "\x00\x09\x02\x00" // 84 |
|
179 | + . "\x00\x00\x00\x00" // 88 |
|
180 | + . "\xc0\x00\x00\x00" // 92 |
|
181 | + . "\x00\x00\x00\x46" // 96 // Seems to be ok only for Root |
|
182 | + . "\x00\x00\x00\x00" // 100 |
|
183 | + . \PhpSpreadsheet\Shared\OLE::localDateToOLE($this->Time1st) // 108 |
|
184 | + . \PhpSpreadsheet\Shared\OLE::localDateToOLE($this->Time2nd) // 116 |
|
185 | + . pack('V', isset($this->startBlock) ? $this->startBlock : 0) // 120 |
|
186 | + . pack('V', $this->Size) // 124 |
|
187 | + . pack('V', 0); // 128 |
|
188 | 188 | return $ret; |
189 | 189 | } |
190 | 190 |
@@ -184,7 +184,7 @@ |
||
184 | 184 | . \PhpSpreadsheet\Shared\OLE::localDateToOLE($this->Time2nd) // 116 |
185 | 185 | . pack('V', isset($this->startBlock) ? $this->startBlock : 0) // 120 |
186 | 186 | . pack('V', $this->Size) // 124 |
187 | - . pack('V', 0); // 128 |
|
187 | + . pack('V', 0); // 128 |
|
188 | 188 | return $ret; |
189 | 189 | } |
190 | 190 |
@@ -137,8 +137,7 @@ |
||
137 | 137 | $this->rotation = 0; |
138 | 138 | $this->shadow = new Drawing\Shadow(); |
139 | 139 | |
140 | - // Set image index |
|
141 | - ++self::$imageCounter; |
|
140 | + // Set image index++self::$imageCounter; |
|
142 | 141 | $this->imageIndex = self::$imageCounter; |
143 | 142 | } |
144 | 143 |
@@ -65,7 +65,7 @@ |
||
65 | 65 | public function testGetCurrencyCode() |
66 | 66 | { |
67 | 67 | $localeconv = localeconv(); |
68 | - $expectedResult = (!empty($localeconv['currency_symbol']) ? $localeconv['currency_symbol'] : (!empty($localeconv['int_curr_symbol']) ? $localeconv['int_curr_symbol']: '$')); |
|
68 | + $expectedResult = (!empty($localeconv['currency_symbol']) ? $localeconv['currency_symbol'] : (!empty($localeconv['int_curr_symbol']) ? $localeconv['int_curr_symbol'] : '$')); |
|
69 | 69 | $result = call_user_func([StringHelper::class, 'getCurrencyCode']); |
70 | 70 | $this->assertEquals($expectedResult, $result); |
71 | 71 | } |
@@ -113,7 +113,7 @@ discard block |
||
113 | 113 | { |
114 | 114 | $attributeSet = ['val' => 100, |
115 | 115 | 'maxVal' => 200, |
116 | - ]; |
|
116 | + ]; |
|
117 | 117 | |
118 | 118 | // Setters return the instance to implement the fluent interface |
119 | 119 | $result = $this->testAutoFilterColumnObject->setAttributes($attributeSet); |
@@ -124,7 +124,7 @@ discard block |
||
124 | 124 | { |
125 | 125 | $attributeSet = ['val' => 100, |
126 | 126 | 'maxVal' => 200, |
127 | - ]; |
|
127 | + ]; |
|
128 | 128 | |
129 | 129 | $this->testAutoFilterColumnObject->setAttributes($attributeSet); |
130 | 130 | |
@@ -137,7 +137,7 @@ discard block |
||
137 | 137 | { |
138 | 138 | $attributeSet = ['val' => 100, |
139 | 139 | 'maxVal' => 200, |
140 | - ]; |
|
140 | + ]; |
|
141 | 141 | |
142 | 142 | foreach ($attributeSet as $attributeName => $attributeValue) { |
143 | 143 | // Setters return the instance to implement the fluent interface |
@@ -150,7 +150,7 @@ discard block |
||
150 | 150 | { |
151 | 151 | $attributeSet = ['val' => 100, |
152 | 152 | 'maxVal' => 200, |
153 | - ]; |
|
153 | + ]; |
|
154 | 154 | |
155 | 155 | $this->testAutoFilterColumnObject->setAttributes($attributeSet); |
156 | 156 |