@@ -125,7 +125,7 @@ |
||
125 | 125 | $xml = $this->toUtf8($xml); |
126 | 126 | |
127 | 127 | // Don't rely purely on libxml_disable_entity_loader() |
128 | - $pattern = '/\\0?' . implode('\\0?', str_split($this->pattern)) . '\\0?/'; |
|
128 | + $pattern = '/\\0?'.implode('\\0?', str_split($this->pattern)).'\\0?/'; |
|
129 | 129 | |
130 | 130 | if (preg_match($pattern, $xml)) { |
131 | 131 | throw new Reader\Exception('Detected use of ENTITY in XML, spreadsheet file load() aborted to prevent XXE/XEE attacks'); |
@@ -95,14 +95,14 @@ discard block |
||
95 | 95 | |
96 | 96 | $zip = new ZipArchive(); |
97 | 97 | if (!$zip->open($pFilename)) { |
98 | - throw new Exception('Could not open ' . $pFilename . ' for reading! Error opening file.'); |
|
98 | + throw new Exception('Could not open '.$pFilename.' for reading! Error opening file.'); |
|
99 | 99 | } |
100 | 100 | |
101 | 101 | $worksheetNames = []; |
102 | 102 | |
103 | 103 | $xml = new XMLReader(); |
104 | 104 | $xml->xml( |
105 | - $this->securityScanner->scanFile('zip://' . realpath($pFilename) . '#content.xml'), |
|
105 | + $this->securityScanner->scanFile('zip://'.realpath($pFilename).'#content.xml'), |
|
106 | 106 | null, |
107 | 107 | Settings::getLibXmlLoaderOptions() |
108 | 108 | ); |
@@ -151,12 +151,12 @@ discard block |
||
151 | 151 | |
152 | 152 | $zip = new ZipArchive(); |
153 | 153 | if (!$zip->open($pFilename)) { |
154 | - throw new Exception('Could not open ' . $pFilename . ' for reading! Error opening file.'); |
|
154 | + throw new Exception('Could not open '.$pFilename.' for reading! Error opening file.'); |
|
155 | 155 | } |
156 | 156 | |
157 | 157 | $xml = new XMLReader(); |
158 | 158 | $xml->xml( |
159 | - $this->securityScanner->scanFile('zip://' . realpath($pFilename) . '#content.xml'), |
|
159 | + $this->securityScanner->scanFile('zip://'.realpath($pFilename).'#content.xml'), |
|
160 | 160 | null, |
161 | 161 | Settings::getLibXmlLoaderOptions() |
162 | 162 | ); |
@@ -397,7 +397,7 @@ discard block |
||
397 | 397 | $text = $this->scanElementForText($textNode->item(0)); |
398 | 398 | |
399 | 399 | $spreadsheet->getActiveSheet() |
400 | - ->getComment($columnID . $rowID) |
|
400 | + ->getComment($columnID.$rowID) |
|
401 | 401 | ->setText($this->parseRichText($text)); |
402 | 402 | // ->setAuthor( $author ) |
403 | 403 | } |
@@ -520,7 +520,7 @@ discard block |
||
520 | 520 | |
521 | 521 | $dataValue = Date::PHPToExcel( |
522 | 522 | strtotime( |
523 | - '01-01-1970 ' . implode(':', sscanf($timeValue, 'PT%dH%dM%dS')) |
|
523 | + '01-01-1970 '.implode(':', sscanf($timeValue, 'PT%dH%dM%dS')) |
|
524 | 524 | ) |
525 | 525 | ); |
526 | 526 | $formatting = NumberFormat::FORMAT_DATE_TIME4; |
@@ -580,7 +580,7 @@ discard block |
||
580 | 580 | $rID = $rowID + $rowAdjust; |
581 | 581 | |
582 | 582 | $cell = $spreadsheet->getActiveSheet() |
583 | - ->getCell($columnID . $rID); |
|
583 | + ->getCell($columnID.$rID); |
|
584 | 584 | |
585 | 585 | // Set value |
586 | 586 | if ($hasCalculatedValue) { |
@@ -596,12 +596,12 @@ discard block |
||
596 | 596 | // Set other properties |
597 | 597 | if ($formatting !== null) { |
598 | 598 | $spreadsheet->getActiveSheet() |
599 | - ->getStyle($columnID . $rID) |
|
599 | + ->getStyle($columnID.$rID) |
|
600 | 600 | ->getNumberFormat() |
601 | 601 | ->setFormatCode($formatting); |
602 | 602 | } else { |
603 | 603 | $spreadsheet->getActiveSheet() |
604 | - ->getStyle($columnID . $rID) |
|
604 | + ->getStyle($columnID.$rID) |
|
605 | 605 | ->getNumberFormat() |
606 | 606 | ->setFormatCode(NumberFormat::FORMAT_GENERAL); |
607 | 607 | } |
@@ -636,7 +636,7 @@ discard block |
||
636 | 636 | $rowTo = $rowTo + (int) $cellData->getAttributeNS($tableNs, 'number-rows-spanned') - 1; |
637 | 637 | } |
638 | 638 | |
639 | - $cellRange = $columnID . $rowID . ':' . $columnTo . $rowTo; |
|
639 | + $cellRange = $columnID.$rowID.':'.$columnTo.$rowTo; |
|
640 | 640 | $spreadsheet->getActiveSheet()->mergeCells($cellRange); |
641 | 641 | } |
642 | 642 | } |
@@ -280,13 +280,13 @@ discard block |
||
280 | 280 | // Only actually write it if there's content in the string |
281 | 281 | // Write to worksheet to be done here... |
282 | 282 | // ... we return the cell so we can mess about with styles more easily |
283 | - $sheet->setCellValue($column . $row, $cellContent); |
|
283 | + $sheet->setCellValue($column.$row, $cellContent); |
|
284 | 284 | $this->dataArray[$row][$column] = $cellContent; |
285 | 285 | } |
286 | 286 | } else { |
287 | 287 | // We have a Rich Text run |
288 | 288 | // TODO |
289 | - $this->dataArray[$row][$column] = 'RICH TEXT: ' . $cellContent; |
|
289 | + $this->dataArray[$row][$column] = 'RICH TEXT: '.$cellContent; |
|
290 | 290 | } |
291 | 291 | $cellContent = (string) ''; |
292 | 292 | } |
@@ -340,7 +340,7 @@ discard block |
||
340 | 340 | case 'strong': |
341 | 341 | case 'b': |
342 | 342 | if (isset($attributeArray['class']) && $attributeArray['class'] === 'comment') { |
343 | - $sheet->getComment($column . $row) |
|
343 | + $sheet->getComment($column.$row) |
|
344 | 344 | ->getText() |
345 | 345 | ->createTextRun($child->textContent); |
346 | 346 | |
@@ -356,7 +356,7 @@ discard block |
||
356 | 356 | } |
357 | 357 | |
358 | 358 | if (isset($this->formats[$child->nodeName])) { |
359 | - $sheet->getStyle($column . $row)->applyFromArray($this->formats[$child->nodeName]); |
|
359 | + $sheet->getStyle($column.$row)->applyFromArray($this->formats[$child->nodeName]); |
|
360 | 360 | } |
361 | 361 | |
362 | 362 | break; |
@@ -364,7 +364,7 @@ discard block |
||
364 | 364 | $this->flushCell($sheet, $column, $row, $cellContent); |
365 | 365 | ++$row; |
366 | 366 | if (isset($this->formats[$child->nodeName])) { |
367 | - $sheet->getStyle($column . $row)->applyFromArray($this->formats[$child->nodeName]); |
|
367 | + $sheet->getStyle($column.$row)->applyFromArray($this->formats[$child->nodeName]); |
|
368 | 368 | } else { |
369 | 369 | $cellContent = '----------'; |
370 | 370 | $this->flushCell($sheet, $column, $row, $cellContent); |
@@ -376,7 +376,7 @@ discard block |
||
376 | 376 | if ($this->tableLevel > 0) { |
377 | 377 | // If we're inside a table, replace with a \n and set the cell to wrap |
378 | 378 | $cellContent .= "\n"; |
379 | - $sheet->getStyle($column . $row)->getAlignment()->setWrapText(true); |
|
379 | + $sheet->getStyle($column.$row)->getAlignment()->setWrapText(true); |
|
380 | 380 | } else { |
381 | 381 | // Otherwise flush our existing content and move the row cursor on |
382 | 382 | $this->flushCell($sheet, $column, $row, $cellContent); |
@@ -388,9 +388,9 @@ discard block |
||
388 | 388 | foreach ($attributeArray as $attributeName => $attributeValue) { |
389 | 389 | switch ($attributeName) { |
390 | 390 | case 'href': |
391 | - $sheet->getCell($column . $row)->getHyperlink()->setUrl($attributeValue); |
|
391 | + $sheet->getCell($column.$row)->getHyperlink()->setUrl($attributeValue); |
|
392 | 392 | if (isset($this->formats[$child->nodeName])) { |
393 | - $sheet->getStyle($column . $row)->applyFromArray($this->formats[$child->nodeName]); |
|
393 | + $sheet->getStyle($column.$row)->applyFromArray($this->formats[$child->nodeName]); |
|
394 | 394 | } |
395 | 395 | |
396 | 396 | break; |
@@ -426,7 +426,7 @@ discard block |
||
426 | 426 | $this->flushCell($sheet, $column, $row, $cellContent); |
427 | 427 | |
428 | 428 | if (isset($this->formats[$child->nodeName])) { |
429 | - $sheet->getStyle($column . $row)->applyFromArray($this->formats[$child->nodeName]); |
|
429 | + $sheet->getStyle($column.$row)->applyFromArray($this->formats[$child->nodeName]); |
|
430 | 430 | } |
431 | 431 | |
432 | 432 | ++$row; |
@@ -490,7 +490,7 @@ discard block |
||
490 | 490 | case 'td': |
491 | 491 | $this->processDomElement($child, $sheet, $row, $column, $cellContent); |
492 | 492 | |
493 | - while (isset($this->rowspan[$column . $row])) { |
|
493 | + while (isset($this->rowspan[$column.$row])) { |
|
494 | 494 | ++$column; |
495 | 495 | } |
496 | 496 | |
@@ -505,7 +505,7 @@ discard block |
||
505 | 505 | for ($i = 0; $i < (int) $attributeArray['colspan'] - 1; ++$i) { |
506 | 506 | ++$columnTo; |
507 | 507 | } |
508 | - $range = $column . $row . ':' . $columnTo . ($row + (int) $attributeArray['rowspan'] - 1); |
|
508 | + $range = $column.$row.':'.$columnTo.($row + (int) $attributeArray['rowspan'] - 1); |
|
509 | 509 | foreach (Coordinate::extractAllCellReferencesInRange($range) as $value) { |
510 | 510 | $this->rowspan[$value] = true; |
511 | 511 | } |
@@ -513,7 +513,7 @@ discard block |
||
513 | 513 | $column = $columnTo; |
514 | 514 | } elseif (isset($attributeArray['rowspan'])) { |
515 | 515 | //create merging rowspan |
516 | - $range = $column . $row . ':' . $column . ($row + (int) $attributeArray['rowspan'] - 1); |
|
516 | + $range = $column.$row.':'.$column.($row + (int) $attributeArray['rowspan'] - 1); |
|
517 | 517 | foreach (Coordinate::extractAllCellReferencesInRange($range) as $value) { |
518 | 518 | $this->rowspan[$value] = true; |
519 | 519 | } |
@@ -524,10 +524,10 @@ discard block |
||
524 | 524 | for ($i = 0; $i < (int) $attributeArray['colspan'] - 1; ++$i) { |
525 | 525 | ++$columnTo; |
526 | 526 | } |
527 | - $sheet->mergeCells($column . $row . ':' . $columnTo . $row); |
|
527 | + $sheet->mergeCells($column.$row.':'.$columnTo.$row); |
|
528 | 528 | $column = $columnTo; |
529 | 529 | } elseif (isset($attributeArray['bgcolor'])) { |
530 | - $sheet->getStyle($column . $row)->applyFromArray( |
|
530 | + $sheet->getStyle($column.$row)->applyFromArray( |
|
531 | 531 | [ |
532 | 532 | 'fill' => [ |
533 | 533 | 'fillType' => Fill::FILL_SOLID, |
@@ -546,15 +546,15 @@ discard block |
||
546 | 546 | } |
547 | 547 | |
548 | 548 | if (isset($attributeArray['align'])) { |
549 | - $sheet->getStyle($column . $row)->getAlignment()->setHorizontal($attributeArray['align']); |
|
549 | + $sheet->getStyle($column.$row)->getAlignment()->setHorizontal($attributeArray['align']); |
|
550 | 550 | } |
551 | 551 | |
552 | 552 | if (isset($attributeArray['valign'])) { |
553 | - $sheet->getStyle($column . $row)->getAlignment()->setVertical($attributeArray['valign']); |
|
553 | + $sheet->getStyle($column.$row)->getAlignment()->setVertical($attributeArray['valign']); |
|
554 | 554 | } |
555 | 555 | |
556 | 556 | if (isset($attributeArray['data-format'])) { |
557 | - $sheet->getStyle($column . $row)->getNumberFormat()->setFormatCode($attributeArray['data-format']); |
|
557 | + $sheet->getStyle($column.$row)->getNumberFormat()->setFormatCode($attributeArray['data-format']); |
|
558 | 558 | } |
559 | 559 | |
560 | 560 | ++$column; |
@@ -589,7 +589,7 @@ discard block |
||
589 | 589 | { |
590 | 590 | // Validate |
591 | 591 | if (!$this->canRead($pFilename)) { |
592 | - throw new Exception($pFilename . ' is an Invalid HTML file.'); |
|
592 | + throw new Exception($pFilename.' is an Invalid HTML file.'); |
|
593 | 593 | } |
594 | 594 | |
595 | 595 | // Create a new DOM object |
@@ -597,7 +597,7 @@ discard block |
||
597 | 597 | // Reload the HTML file into the DOM object |
598 | 598 | $loaded = $dom->loadHTML(mb_convert_encoding($this->securityScanner->scanFile($pFilename), 'HTML-ENTITIES', 'UTF-8')); |
599 | 599 | if ($loaded === false) { |
600 | - throw new Exception('Failed to load ' . $pFilename . ' as a DOM Document'); |
|
600 | + throw new Exception('Failed to load '.$pFilename.' as a DOM Document'); |
|
601 | 601 | } |
602 | 602 | |
603 | 603 | return $this->loadDocument($dom, $spreadsheet); |
@@ -699,7 +699,7 @@ discard block |
||
699 | 699 | return; |
700 | 700 | } |
701 | 701 | |
702 | - $cellStyle = $sheet->getStyle($column . $row); |
|
702 | + $cellStyle = $sheet->getStyle($column.$row); |
|
703 | 703 | |
704 | 704 | // add color styles (background & text) from dom element,currently support : td & th, using ONLY inline css style with RGB color |
705 | 705 | $styles = explode(';', $attributeArray['style']); |
@@ -879,7 +879,7 @@ discard block |
||
879 | 879 | $drawing = new Drawing(); |
880 | 880 | $drawing->setPath($src); |
881 | 881 | $drawing->setWorksheet($sheet); |
882 | - $drawing->setCoordinates($column . $row); |
|
882 | + $drawing->setCoordinates($column.$row); |
|
883 | 883 | $drawing->setOffsetX(0); |
884 | 884 | $drawing->setOffsetY(10); |
885 | 885 | $drawing->setResizeProportional(true); |
@@ -115,7 +115,7 @@ discard block |
||
115 | 115 | { |
116 | 116 | // Open file |
117 | 117 | if (!$this->canRead($pFilename)) { |
118 | - throw new Exception($pFilename . ' is an Invalid Spreadsheet file.'); |
|
118 | + throw new Exception($pFilename.' is an Invalid Spreadsheet file.'); |
|
119 | 119 | } |
120 | 120 | $this->openFile($pFilename); |
121 | 121 | $fileHandle = $this->fileHandle; |
@@ -204,7 +204,7 @@ discard block |
||
204 | 204 | { |
205 | 205 | // Open file |
206 | 206 | if (!$this->canRead($pFilename)) { |
207 | - throw new Exception($pFilename . ' is an Invalid Spreadsheet file.'); |
|
207 | + throw new Exception($pFilename.' is an Invalid Spreadsheet file.'); |
|
208 | 208 | } |
209 | 209 | $this->openFile($pFilename); |
210 | 210 | $fileHandle = $this->fileHandle; |
@@ -285,7 +285,7 @@ discard block |
||
285 | 285 | break; |
286 | 286 | } |
287 | 287 | } |
288 | - $this->formats['P' . $this->format++] = $formatArray; |
|
288 | + $this->formats['P'.$this->format++] = $formatArray; |
|
289 | 289 | // Read cell value data |
290 | 290 | } elseif ($dataType == 'C') { |
291 | 291 | $hasCalculatedValue = false; |
@@ -307,7 +307,7 @@ discard block |
||
307 | 307 | |
308 | 308 | break; |
309 | 309 | case 'E': |
310 | - $cellDataFormula = '=' . substr($rowDatum, 1); |
|
310 | + $cellDataFormula = '='.substr($rowDatum, 1); |
|
311 | 311 | // Convert R1C1 style references to A1 style references (but only when not quoted) |
312 | 312 | $temp = explode('"', $cellDataFormula); |
313 | 313 | $key = false; |
@@ -340,7 +340,7 @@ discard block |
||
340 | 340 | if ($columnReference[0] == '[') { |
341 | 341 | $columnReference = $column + trim($columnReference, '[]'); |
342 | 342 | } |
343 | - $A1CellReference = Coordinate::stringFromColumnIndex($columnReference) . $rowReference; |
|
343 | + $A1CellReference = Coordinate::stringFromColumnIndex($columnReference).$rowReference; |
|
344 | 344 | |
345 | 345 | $value = substr_replace($value, $A1CellReference, $cellReference[0][1], strlen($cellReference[0][0])); |
346 | 346 | } |
@@ -358,10 +358,10 @@ discard block |
||
358 | 358 | $cellData = Calculation::unwrapResult($cellData); |
359 | 359 | |
360 | 360 | // Set cell value |
361 | - $spreadsheet->getActiveSheet()->getCell($columnLetter . $row)->setValue(($hasCalculatedValue) ? $cellDataFormula : $cellData); |
|
361 | + $spreadsheet->getActiveSheet()->getCell($columnLetter.$row)->setValue(($hasCalculatedValue) ? $cellDataFormula : $cellData); |
|
362 | 362 | if ($hasCalculatedValue) { |
363 | 363 | $cellData = Calculation::unwrapResult($cellData); |
364 | - $spreadsheet->getActiveSheet()->getCell($columnLetter . $row)->setCalculatedValue($cellData); |
|
364 | + $spreadsheet->getActiveSheet()->getCell($columnLetter.$row)->setCalculatedValue($cellData); |
|
365 | 365 | } |
366 | 366 | // Read cell formatting |
367 | 367 | } elseif ($dataType == 'F') { |
@@ -425,12 +425,12 @@ discard block |
||
425 | 425 | if (($formatStyle > '') && ($column > '') && ($row > '')) { |
426 | 426 | $columnLetter = Coordinate::stringFromColumnIndex($column); |
427 | 427 | if (isset($this->formats[$formatStyle])) { |
428 | - $spreadsheet->getActiveSheet()->getStyle($columnLetter . $row)->applyFromArray($this->formats[$formatStyle]); |
|
428 | + $spreadsheet->getActiveSheet()->getStyle($columnLetter.$row)->applyFromArray($this->formats[$formatStyle]); |
|
429 | 429 | } |
430 | 430 | } |
431 | 431 | if ((!empty($styleData)) && ($column > '') && ($row > '')) { |
432 | 432 | $columnLetter = Coordinate::stringFromColumnIndex($column); |
433 | - $spreadsheet->getActiveSheet()->getStyle($columnLetter . $row)->applyFromArray($styleData); |
|
433 | + $spreadsheet->getActiveSheet()->getStyle($columnLetter.$row)->applyFromArray($styleData); |
|
434 | 434 | } |
435 | 435 | if ($columnWidth > '') { |
436 | 436 | if ($startCol == $endCol) { |
@@ -131,7 +131,7 @@ discard block |
||
131 | 131 | unset($this->index[$pCoord]); |
132 | 132 | |
133 | 133 | // Delete the entry from cache |
134 | - $this->cache->delete($this->cachePrefix . $pCoord); |
|
134 | + $this->cache->delete($this->cachePrefix.$pCoord); |
|
135 | 135 | } |
136 | 136 | |
137 | 137 | /** |
@@ -178,7 +178,7 @@ discard block |
||
178 | 178 | $r = 0; |
179 | 179 | sscanf($coord, '%[A-Z]%d', $c, $r); |
180 | 180 | $row[$r] = $r; |
181 | - $col[$c] = strlen($c) . $c; |
|
181 | + $col[$c] = strlen($c).$c; |
|
182 | 182 | } |
183 | 183 | |
184 | 184 | // Determine highest column and row |
@@ -300,7 +300,7 @@ discard block |
||
300 | 300 | */ |
301 | 301 | private function getUniqueID() |
302 | 302 | { |
303 | - return uniqid('phpspreadsheet.', true) . '.'; |
|
303 | + return uniqid('phpspreadsheet.', true).'.'; |
|
304 | 304 | } |
305 | 305 | |
306 | 306 | /** |
@@ -390,7 +390,7 @@ discard block |
||
390 | 390 | if ($this->currentCellIsDirty && !empty($this->currentCoordinate)) { |
391 | 391 | $this->currentCell->detach(); |
392 | 392 | |
393 | - $stored = $this->cache->set($this->cachePrefix . $this->currentCoordinate, $this->currentCell); |
|
393 | + $stored = $this->cache->set($this->cachePrefix.$this->currentCoordinate, $this->currentCell); |
|
394 | 394 | if (!$stored) { |
395 | 395 | $this->__destruct(); |
396 | 396 | |
@@ -449,7 +449,7 @@ discard block |
||
449 | 449 | } |
450 | 450 | |
451 | 451 | // Check if the entry that has been requested actually exists |
452 | - $cell = $this->cache->get($this->cachePrefix . $pCoord); |
|
452 | + $cell = $this->cache->get($this->cachePrefix.$pCoord); |
|
453 | 453 | if ($cell === null) { |
454 | 454 | throw new PhpSpreadsheetException("Cell entry {$pCoord} no longer exists in cache. This probably means that the cache was cleared by someone else."); |
455 | 455 | } |
@@ -500,7 +500,7 @@ discard block |
||
500 | 500 | private function getAllCacheKeys() |
501 | 501 | { |
502 | 502 | foreach ($this->getCoordinates() as $coordinate) { |
503 | - yield $this->cachePrefix . $coordinate; |
|
503 | + yield $this->cachePrefix.$coordinate; |
|
504 | 504 | } |
505 | 505 | } |
506 | 506 | } |
@@ -205,7 +205,7 @@ discard block |
||
205 | 205 | public static function registerWriter($writerType, $writerClass) |
206 | 206 | { |
207 | 207 | if (!is_a($writerClass, Writer\IWriter::class, true)) { |
208 | - throw new Writer\Exception('Registered writers must implement ' . Writer\IWriter::class); |
|
208 | + throw new Writer\Exception('Registered writers must implement '.Writer\IWriter::class); |
|
209 | 209 | } |
210 | 210 | |
211 | 211 | self::$writers[$writerType] = $writerClass; |
@@ -220,7 +220,7 @@ discard block |
||
220 | 220 | public static function registerReader($readerType, $readerClass) |
221 | 221 | { |
222 | 222 | if (!is_a($readerClass, Reader\IReader::class, true)) { |
223 | - throw new Reader\Exception('Registered readers must implement ' . Reader\IReader::class); |
|
223 | + throw new Reader\Exception('Registered readers must implement '.Reader\IReader::class); |
|
224 | 224 | } |
225 | 225 | |
226 | 226 | self::$readers[$readerType] = $readerClass; |
@@ -44,7 +44,7 @@ discard block |
||
44 | 44 | } |
45 | 45 | |
46 | 46 | // Check for number in scientific format |
47 | - if (preg_match('/^' . Calculation::CALCULATION_REGEXP_NUMBER . '$/', $value)) { |
|
47 | + if (preg_match('/^'.Calculation::CALCULATION_REGEXP_NUMBER.'$/', $value)) { |
|
48 | 48 | $cell->setValueExplicit((float) $value, DataType::TYPE_NUMERIC); |
49 | 49 | |
50 | 50 | return true; |
@@ -93,7 +93,7 @@ discard block |
||
93 | 93 | $currencyCode = StringHelper::getCurrencyCode(); |
94 | 94 | $decimalSeparator = StringHelper::getDecimalSeparator(); |
95 | 95 | $thousandsSeparator = StringHelper::getThousandsSeparator(); |
96 | - if (preg_match('/^' . preg_quote($currencyCode, '/') . ' *(\d{1,3}(' . preg_quote($thousandsSeparator, '/') . '\d{3})*|(\d+))(' . preg_quote($decimalSeparator, '/') . '\d{2})?$/', $value)) { |
|
96 | + if (preg_match('/^'.preg_quote($currencyCode, '/').' *(\d{1,3}('.preg_quote($thousandsSeparator, '/').'\d{3})*|(\d+))('.preg_quote($decimalSeparator, '/').'\d{2})?$/', $value)) { |
|
97 | 97 | // Convert value to number |
98 | 98 | $value = (float) trim(str_replace([$currencyCode, $thousandsSeparator, $decimalSeparator], ['', '', '.'], $value)); |
99 | 99 | $cell->setValueExplicit($value, DataType::TYPE_NUMERIC); |
@@ -105,8 +105,8 @@ |
||
105 | 105 | public function getHashCode() |
106 | 106 | { |
107 | 107 | return md5( |
108 | - $this->url . |
|
109 | - $this->tooltip . |
|
108 | + $this->url. |
|
109 | + $this->tooltip. |
|
110 | 110 | __CLASS__ |
111 | 111 | ); |
112 | 112 | } |
@@ -236,7 +236,7 @@ discard block |
||
236 | 236 | |
237 | 237 | break; |
238 | 238 | default: |
239 | - throw new Exception('Invalid datatype: ' . $pDataType); |
|
239 | + throw new Exception('Invalid datatype: '.$pDataType); |
|
240 | 240 | |
241 | 241 | break; |
242 | 242 | } |
@@ -275,7 +275,7 @@ discard block |
||
275 | 275 | } |
276 | 276 | |
277 | 277 | throw new \PhpOffice\PhpSpreadsheet\Calculation\Exception( |
278 | - $this->getWorksheet()->getTitle() . '!' . $this->getCoordinate() . ' -> ' . $ex->getMessage() |
|
278 | + $this->getWorksheet()->getTitle().'!'.$this->getCoordinate().' -> '.$ex->getMessage() |
|
279 | 279 | ); |
280 | 280 | } |
281 | 281 |