@@ -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 | |
@@ -39,7 +39,7 @@ discard block |
||
| 39 | 39 | throw new Exception('Cell coordinate can not be zero-length string'); |
| 40 | 40 | } |
| 41 | 41 | |
| 42 | - throw new Exception('Invalid cell coordinate ' . $pCoordinateString); |
|
| 42 | + throw new Exception('Invalid cell coordinate '.$pCoordinateString); |
|
| 43 | 43 | } |
| 44 | 44 | |
| 45 | 45 | /** |
@@ -78,12 +78,12 @@ discard block |
||
| 78 | 78 | |
| 79 | 79 | // Create absolute coordinate |
| 80 | 80 | if (ctype_digit($pCoordinateString)) { |
| 81 | - return $worksheet . '$' . $pCoordinateString; |
|
| 81 | + return $worksheet.'$'.$pCoordinateString; |
|
| 82 | 82 | } elseif (ctype_alpha($pCoordinateString)) { |
| 83 | - return $worksheet . '$' . strtoupper($pCoordinateString); |
|
| 83 | + return $worksheet.'$'.strtoupper($pCoordinateString); |
|
| 84 | 84 | } |
| 85 | 85 | |
| 86 | - return $worksheet . self::absoluteCoordinate($pCoordinateString); |
|
| 86 | + return $worksheet.self::absoluteCoordinate($pCoordinateString); |
|
| 87 | 87 | } |
| 88 | 88 | |
| 89 | 89 | /** |
@@ -112,7 +112,7 @@ discard block |
||
| 112 | 112 | $column = ltrim($column, '$'); |
| 113 | 113 | $row = ltrim($row, '$'); |
| 114 | 114 | |
| 115 | - return $worksheet . '$' . $column . '$' . $row; |
|
| 115 | + return $worksheet.'$'.$column.'$'.$row; |
|
| 116 | 116 | } |
| 117 | 117 | |
| 118 | 118 | /** |
@@ -289,7 +289,7 @@ discard block |
||
| 289 | 289 | } |
| 290 | 290 | } |
| 291 | 291 | |
| 292 | - throw new Exception('Column string index can not be ' . ((isset($pString[0])) ? 'longer than 3 characters' : 'empty')); |
|
| 292 | + throw new Exception('Column string index can not be '.((isset($pString[0])) ? 'longer than 3 characters' : 'empty')); |
|
| 293 | 293 | } |
| 294 | 294 | |
| 295 | 295 | /** |
@@ -309,7 +309,7 @@ discard block |
||
| 309 | 309 | do { |
| 310 | 310 | $characterValue = ($indexValue % 26) ?: 26; |
| 311 | 311 | $indexValue = ($indexValue - $characterValue) / 26; |
| 312 | - $base26 = chr($characterValue + 64) . ($base26 ?: ''); |
|
| 312 | + $base26 = chr($characterValue + 64).($base26 ?: ''); |
|
| 313 | 313 | } while ($indexValue > 0); |
| 314 | 314 | $indexCache[$columnIndex] = $base26; |
| 315 | 315 | } |
@@ -392,7 +392,7 @@ discard block |
||
| 392 | 392 | // Loop cells |
| 393 | 393 | while ($currentColumnIndex < $endColumnIndex) { |
| 394 | 394 | while ($currentRow <= $endRow) { |
| 395 | - $returnValue[] = self::stringFromColumnIndex($currentColumnIndex) . $currentRow; |
|
| 395 | + $returnValue[] = self::stringFromColumnIndex($currentColumnIndex).$currentRow; |
|
| 396 | 396 | ++$currentRow; |
| 397 | 397 | } |
| 398 | 398 | ++$currentColumnIndex; |
@@ -434,7 +434,7 @@ discard block |
||
| 434 | 434 | |
| 435 | 435 | [$column, $row] = self::coordinateFromString($coord); |
| 436 | 436 | $row = (int) (ltrim($row, '$')); |
| 437 | - $hashCode = $column . '-' . (is_object($value) ? $value->getHashCode() : $value); |
|
| 437 | + $hashCode = $column.'-'.(is_object($value) ? $value->getHashCode() : $value); |
|
| 438 | 438 | |
| 439 | 439 | if (!isset($hashedValues[$hashCode])) { |
| 440 | 440 | $hashedValues[$hashCode] = (object) [ |
@@ -463,9 +463,9 @@ discard block |
||
| 463 | 463 | $rowEnd = $row; |
| 464 | 464 | } else { |
| 465 | 465 | if ($rowStart == $rowEnd) { |
| 466 | - $ranges[] = $hashedValue->col . $rowStart; |
|
| 466 | + $ranges[] = $hashedValue->col.$rowStart; |
|
| 467 | 467 | } else { |
| 468 | - $ranges[] = $hashedValue->col . $rowStart . ':' . $hashedValue->col . $rowEnd; |
|
| 468 | + $ranges[] = $hashedValue->col.$rowStart.':'.$hashedValue->col.$rowEnd; |
|
| 469 | 469 | } |
| 470 | 470 | |
| 471 | 471 | $rowStart = $row; |
@@ -475,9 +475,9 @@ discard block |
||
| 475 | 475 | |
| 476 | 476 | if ($rowStart !== null) { |
| 477 | 477 | if ($rowStart == $rowEnd) { |
| 478 | - $ranges[] = $hashedValue->col . $rowStart; |
|
| 478 | + $ranges[] = $hashedValue->col.$rowStart; |
|
| 479 | 479 | } else { |
| 480 | - $ranges[] = $hashedValue->col . $rowStart . ':' . $hashedValue->col . $rowEnd; |
|
| 480 | + $ranges[] = $hashedValue->col.$rowStart.':'.$hashedValue->col.$rowEnd; |
|
| 481 | 481 | } |
| 482 | 482 | } |
| 483 | 483 | |
@@ -514,7 +514,7 @@ discard block |
||
| 514 | 514 | private static function validateRange($cellBlock, $startColumnIndex, $endColumnIndex, $currentRow, $endRow) |
| 515 | 515 | { |
| 516 | 516 | if ($startColumnIndex >= $endColumnIndex || $currentRow > $endRow) { |
| 517 | - throw new Exception('Invalid range: "' . $cellBlock . '"'); |
|
| 517 | + throw new Exception('Invalid range: "'.$cellBlock.'"'); |
|
| 518 | 518 | } |
| 519 | 519 | } |
| 520 | 520 | } |
@@ -59,7 +59,7 @@ |
||
| 59 | 59 | return in_array(strtolower($cellValue), explode(',', strtolower(trim($formula1, '"'))), true); |
| 60 | 60 | } elseif (strpos($formula1, ':') > 0) { |
| 61 | 61 | // values list cells |
| 62 | - $matchFormula = '=MATCH(' . $cell->getCoordinate() . ', ' . $formula1 . ', 0)'; |
|
| 62 | + $matchFormula = '=MATCH('.$cell->getCoordinate().', '.$formula1.', 0)'; |
|
| 63 | 63 | $calculation = Calculation::getInstance($cell->getWorksheet()->getParent()); |
| 64 | 64 | |
| 65 | 65 | try { |
@@ -447,19 +447,19 @@ |
||
| 447 | 447 | public function getHashCode() |
| 448 | 448 | { |
| 449 | 449 | return md5( |
| 450 | - $this->formula1 . |
|
| 451 | - $this->formula2 . |
|
| 452 | - $this->type . |
|
| 453 | - $this->errorStyle . |
|
| 454 | - $this->operator . |
|
| 455 | - ($this->allowBlank ? 't' : 'f') . |
|
| 456 | - ($this->showDropDown ? 't' : 'f') . |
|
| 457 | - ($this->showInputMessage ? 't' : 'f') . |
|
| 458 | - ($this->showErrorMessage ? 't' : 'f') . |
|
| 459 | - $this->errorTitle . |
|
| 460 | - $this->error . |
|
| 461 | - $this->promptTitle . |
|
| 462 | - $this->prompt . |
|
| 450 | + $this->formula1. |
|
| 451 | + $this->formula2. |
|
| 452 | + $this->type. |
|
| 453 | + $this->errorStyle. |
|
| 454 | + $this->operator. |
|
| 455 | + ($this->allowBlank ? 't' : 'f'). |
|
| 456 | + ($this->showDropDown ? 't' : 'f'). |
|
| 457 | + ($this->showInputMessage ? 't' : 'f'). |
|
| 458 | + ($this->showErrorMessage ? 't' : 'f'). |
|
| 459 | + $this->errorTitle. |
|
| 460 | + $this->error. |
|
| 461 | + $this->promptTitle. |
|
| 462 | + $this->prompt. |
|
| 463 | 463 | __CLASS__ |
| 464 | 464 | ); |
| 465 | 465 | } |