@@ -55,7 +55,7 @@ discard block |
||
55 | 55 | * If a resource pointer to a stream created by fopen() is passed |
56 | 56 | * it will be used, but you have to close such stream by yourself. |
57 | 57 | * |
58 | - * @param string|resource $filename The name of the file or stream where to save the OLE container |
|
58 | + * @param string|null $filename The name of the file or stream where to save the OLE container |
|
59 | 59 | * |
60 | 60 | * @throws \PhpOffice\PhpSpreadsheet\Writer\WriteException |
61 | 61 | * |
@@ -120,7 +120,7 @@ discard block |
||
120 | 120 | * |
121 | 121 | * @param array $raList Reference to an array of PPS's |
122 | 122 | * |
123 | - * @return float[] The array of numbers |
|
123 | + * @return double[] The array of numbers |
|
124 | 124 | */ |
125 | 125 | public function _calcSize(&$raList) |
126 | 126 | { |
@@ -234,7 +234,7 @@ |
||
234 | 234 | .pack('V', 0)// Extra BDList Count |
235 | 235 | ); |
236 | 236 | } else { |
237 | - fwrite($FILE, pack('V', $iAll + $iBdCnt).pack('V', $iBdExL)); |
|
237 | + fwrite($FILE, pack('V', $iAll + $iBdCnt) . pack('V', $iBdExL)); |
|
238 | 238 | } |
239 | 239 | |
240 | 240 | // BDList |
@@ -387,7 +387,7 @@ |
||
387 | 387 | /** |
388 | 388 | * Get Contiguous |
389 | 389 | * |
390 | - * @return bool |
|
390 | + * @return integer |
|
391 | 391 | */ |
392 | 392 | public function getContiguous() |
393 | 393 | { |
@@ -3,7 +3,7 @@ discard block |
||
3 | 3 | namespace PhpOffice\PhpSpreadsheet\Shared; |
4 | 4 | |
5 | 5 | if (!defined('PCLZIP_TEMPORARY_DIR')) { |
6 | - define('PCLZIP_TEMPORARY_DIR', File::sysGetTempDir().DIRECTORY_SEPARATOR); |
|
6 | + define('PCLZIP_TEMPORARY_DIR', File::sysGetTempDir() . DIRECTORY_SEPARATOR); |
|
7 | 7 | } |
8 | 8 | |
9 | 9 | use PhpOffice\PhpSpreadsheet\Shared\PCLZip\PclZip; |
@@ -86,16 +86,16 @@ discard block |
||
86 | 86 | { |
87 | 87 | $filenameParts = pathinfo($localname); |
88 | 88 | |
89 | - $handle = fopen($this->tempDir.'/'.$filenameParts['basename'], 'wb'); |
|
89 | + $handle = fopen($this->tempDir . '/' . $filenameParts['basename'], 'wb'); |
|
90 | 90 | fwrite($handle, $contents); |
91 | 91 | fclose($handle); |
92 | 92 | |
93 | - $res = $this->zip->add($this->tempDir.'/'.$filenameParts['basename'], PCLZIP_OPT_REMOVE_PATH, $this->tempDir, PCLZIP_OPT_ADD_PATH, $filenameParts['dirname']); |
|
93 | + $res = $this->zip->add($this->tempDir . '/' . $filenameParts['basename'], PCLZIP_OPT_REMOVE_PATH, $this->tempDir, PCLZIP_OPT_ADD_PATH, $filenameParts['dirname']); |
|
94 | 94 | if ($res == 0) { |
95 | - throw new \PhpOffice\PhpSpreadsheet\Writer\WriteException('Error zipping files : '.$this->zip->errorInfo(true)); |
|
95 | + throw new \PhpOffice\PhpSpreadsheet\Writer\WriteException('Error zipping files : ' . $this->zip->errorInfo(true)); |
|
96 | 96 | } |
97 | 97 | |
98 | - unlink($this->tempDir.'/'.$filenameParts['basename']); |
|
98 | + unlink($this->tempDir . '/' . $filenameParts['basename']); |
|
99 | 99 | } |
100 | 100 | |
101 | 101 | /** |
@@ -172,7 +172,7 @@ |
||
172 | 172 | * @param int $offset byte offset |
173 | 173 | * @param int $whence SEEK_SET, SEEK_CUR or SEEK_END |
174 | 174 | * |
175 | - * @return bool |
|
175 | + * @return boolean|null |
|
176 | 176 | */ |
177 | 177 | public function stream_seek($offset, $whence) // @codingStandardsIgnoreLine |
178 | 178 | { |
@@ -81,7 +81,7 @@ |
||
81 | 81 | { |
82 | 82 | // Check for mode |
83 | 83 | if ($mode{0} != 'r') { |
84 | - throw new \PhpOffice\PhpSpreadsheet\Reader\Exception('Mode '.$mode.' is not supported. Only read mode is supported.'); |
|
84 | + throw new \PhpOffice\PhpSpreadsheet\Reader\Exception('Mode ' . $mode . ' is not supported. Only read mode is supported.'); |
|
85 | 85 | } |
86 | 86 | |
87 | 87 | $pos = strrpos($path, '#'); |
@@ -615,7 +615,7 @@ discard block |
||
615 | 615 | * |
616 | 616 | * @param string $index Chart index position |
617 | 617 | * @throws Exception |
618 | - * @return false|Chart |
|
618 | + * @return null|Chart |
|
619 | 619 | */ |
620 | 620 | public function getChartByIndex($index = null) |
621 | 621 | { |
@@ -1130,7 +1130,7 @@ discard block |
||
1130 | 1130 | * Set a cell value |
1131 | 1131 | * |
1132 | 1132 | * @param string $pCoordinate Coordinate of the cell |
1133 | - * @param mixed $pValue Value of the cell |
|
1133 | + * @param integer $pValue Value of the cell |
|
1134 | 1134 | * @param bool $returnCell Return the worksheet (false, default) or the cell (true) |
1135 | 1135 | * @return Worksheet|Cell Depending on the last parameter being specified |
1136 | 1136 | */ |
@@ -1241,8 +1241,8 @@ discard block |
||
1241 | 1241 | /** |
1242 | 1242 | * Get cell at a specific coordinate by using numeric cell coordinates |
1243 | 1243 | * |
1244 | - * @param string $pColumn Numeric column coordinate of the cell |
|
1245 | - * @param string $pRow Numeric row coordinate of the cell |
|
1244 | + * @param integer $pColumn Numeric column coordinate of the cell |
|
1245 | + * @param integer $pRow Numeric row coordinate of the cell |
|
1246 | 1246 | * @param bool $createIfNotExists Flag indicating whether a new cell should be created if it doesn't |
1247 | 1247 | * already exist, or a null should be returned instead |
1248 | 1248 | * @return null|Cell Cell that was found/created or null |
@@ -1350,8 +1350,8 @@ discard block |
||
1350 | 1350 | /** |
1351 | 1351 | * Cell at a specific coordinate by using numeric cell coordinates exists? |
1352 | 1352 | * |
1353 | - * @param string $pColumn Numeric column coordinate of the cell |
|
1354 | - * @param string $pRow Numeric row coordinate of the cell |
|
1353 | + * @param integer $pColumn Numeric column coordinate of the cell |
|
1354 | + * @param integer $pRow Numeric row coordinate of the cell |
|
1355 | 1355 | * @return bool |
1356 | 1356 | */ |
1357 | 1357 | public function cellExistsByColumnAndRow($pColumn = 0, $pRow = 1) |
@@ -1968,7 +1968,7 @@ discard block |
||
1968 | 1968 | /** |
1969 | 1969 | * Set AutoFilter |
1970 | 1970 | * |
1971 | - * @param AutoFilter|string $pValue |
|
1971 | + * @param string $pValue |
|
1972 | 1972 | * A simple string containing a Cell range like 'A1:E10' is permitted for backward compatibility |
1973 | 1973 | * @throws Exception |
1974 | 1974 | * @return Worksheet |
@@ -2991,7 +2991,7 @@ discard block |
||
2991 | 2991 | * |
2992 | 2992 | * @param null|string Same rule as Title minus space not allowed (but, like Excel, change silently space to underscore) |
2993 | 2993 | * @throws Exception |
2994 | - * @return objWorksheet |
|
2994 | + * @return Worksheet |
|
2995 | 2995 | */ |
2996 | 2996 | public function setCodeName($pValue = null) |
2997 | 2997 | { |
@@ -507,7 +507,7 @@ discard block |
||
507 | 507 | * |
508 | 508 | * @param mixed $token The token to convert |
509 | 509 | * |
510 | - * @return mixed the converted token on success |
|
510 | + * @return string the converted token on success |
|
511 | 511 | */ |
512 | 512 | private function convert($token) |
513 | 513 | { |
@@ -577,7 +577,7 @@ discard block |
||
577 | 577 | * |
578 | 578 | * @param string $string A string for conversion to its ptg value |
579 | 579 | * |
580 | - * @return mixed the converted token on success |
|
580 | + * @return string the converted token on success |
|
581 | 581 | */ |
582 | 582 | private function convertString($string) |
583 | 583 | { |
@@ -656,7 +656,7 @@ discard block |
||
656 | 656 | * |
657 | 657 | * @param string $token An Excel range in the Sheet1!A1:A2 format |
658 | 658 | * |
659 | - * @return mixed The packed ptgArea3d token on success |
|
659 | + * @return string The packed ptgArea3d token on success |
|
660 | 660 | */ |
661 | 661 | private function convertRange3d($token) |
662 | 662 | { |
@@ -708,7 +708,7 @@ discard block |
||
708 | 708 | * |
709 | 709 | * @param string $cell An Excel cell reference |
710 | 710 | * |
711 | - * @return mixed The packed ptgRef3d token on success |
|
711 | + * @return string The packed ptgRef3d token on success |
|
712 | 712 | */ |
713 | 713 | private function convertRef3d($cell) |
714 | 714 | { |
@@ -807,7 +807,7 @@ discard block |
||
807 | 807 | * |
808 | 808 | * @param string $ext_ref The name of the external reference |
809 | 809 | * |
810 | - * @return mixed The reference index in packed() format on success |
|
810 | + * @return string The reference index in packed() format on success |
|
811 | 811 | */ |
812 | 812 | private function getRefIndex($ext_ref) |
813 | 813 | { |
@@ -898,7 +898,7 @@ discard block |
||
898 | 898 | * |
899 | 899 | * @param string $cell The Excel cell reference to be packed |
900 | 900 | * |
901 | - * @return array Array containing the row and column in packed() format |
|
901 | + * @return string[] Array containing the row and column in packed() format |
|
902 | 902 | */ |
903 | 903 | private function cellToPackedRowcol($cell) |
904 | 904 | { |
@@ -927,7 +927,7 @@ discard block |
||
927 | 927 | * |
928 | 928 | * @param string $range The Excel range to be packed |
929 | 929 | * |
930 | - * @return array Array containing (row1,col1,row2,col2) in packed() format |
|
930 | + * @return string[] Array containing (row1,col1,row2,col2) in packed() format |
|
931 | 931 | */ |
932 | 932 | private function rangeToPackedRange($range) |
933 | 933 | { |
@@ -1043,7 +1043,7 @@ discard block |
||
1043 | 1043 | /** |
1044 | 1044 | * Checks if it's a valid token. |
1045 | 1045 | * |
1046 | - * @param mixed $token The token to check |
|
1046 | + * @param string $token The token to check |
|
1047 | 1047 | * |
1048 | 1048 | * @return mixed The checked token or false on failure |
1049 | 1049 | */ |
@@ -1129,7 +1129,7 @@ discard block |
||
1129 | 1129 | * @param string $formula The formula to parse, without the initial equal |
1130 | 1130 | * sign (=) |
1131 | 1131 | * |
1132 | - * @return mixed true on success |
|
1132 | + * @return boolean true on success |
|
1133 | 1133 | */ |
1134 | 1134 | public function parse($formula) |
1135 | 1135 | { |
@@ -519,19 +519,19 @@ discard block |
||
519 | 519 | } elseif (preg_match('/^\$?([A-Ia-i]?[A-Za-z])\$?(\d+)$/', $token)) { |
520 | 520 | return $this->convertRef2d($token); |
521 | 521 | // match external references like Sheet1!A1 or Sheet1:Sheet2!A1 or Sheet1!$A$1 or Sheet1:Sheet2!$A$1 |
522 | - } elseif (preg_match('/^'.self::REGEX_SHEET_TITLE_UNQUOTED."(\:".self::REGEX_SHEET_TITLE_UNQUOTED.")?\!\\$?[A-Ia-i]?[A-Za-z]\\$?(\d+)$/u", $token)) { |
|
522 | + } elseif (preg_match('/^' . self::REGEX_SHEET_TITLE_UNQUOTED . "(\:" . self::REGEX_SHEET_TITLE_UNQUOTED . ")?\!\\$?[A-Ia-i]?[A-Za-z]\\$?(\d+)$/u", $token)) { |
|
523 | 523 | return $this->convertRef3d($token); |
524 | 524 | // match external references like 'Sheet1'!A1 or 'Sheet1:Sheet2'!A1 or 'Sheet1'!$A$1 or 'Sheet1:Sheet2'!$A$1 |
525 | - } elseif (preg_match("/^'".self::REGEX_SHEET_TITLE_QUOTED."(\:".self::REGEX_SHEET_TITLE_QUOTED.")?'\!\\$?[A-Ia-i]?[A-Za-z]\\$?(\d+)$/u", $token)) { |
|
525 | + } elseif (preg_match("/^'" . self::REGEX_SHEET_TITLE_QUOTED . "(\:" . self::REGEX_SHEET_TITLE_QUOTED . ")?'\!\\$?[A-Ia-i]?[A-Za-z]\\$?(\d+)$/u", $token)) { |
|
526 | 526 | return $this->convertRef3d($token); |
527 | 527 | // match ranges like A1:B2 or $A$1:$B$2 |
528 | 528 | } elseif (preg_match('/^(\$)?[A-Ia-i]?[A-Za-z](\$)?(\d+)\:(\$)?[A-Ia-i]?[A-Za-z](\$)?(\d+)$/', $token)) { |
529 | 529 | return $this->convertRange2d($token); |
530 | 530 | // match external ranges like Sheet1!A1:B2 or Sheet1:Sheet2!A1:B2 or Sheet1!$A$1:$B$2 or Sheet1:Sheet2!$A$1:$B$2 |
531 | - } elseif (preg_match('/^'.self::REGEX_SHEET_TITLE_UNQUOTED."(\:".self::REGEX_SHEET_TITLE_UNQUOTED.")?\!\\$?([A-Ia-i]?[A-Za-z])?\\$?(\d+)\:\\$?([A-Ia-i]?[A-Za-z])?\\$?(\d+)$/u", $token)) { |
|
531 | + } elseif (preg_match('/^' . self::REGEX_SHEET_TITLE_UNQUOTED . "(\:" . self::REGEX_SHEET_TITLE_UNQUOTED . ")?\!\\$?([A-Ia-i]?[A-Za-z])?\\$?(\d+)\:\\$?([A-Ia-i]?[A-Za-z])?\\$?(\d+)$/u", $token)) { |
|
532 | 532 | return $this->convertRange3d($token); |
533 | 533 | // match external ranges like 'Sheet1'!A1:B2 or 'Sheet1:Sheet2'!A1:B2 or 'Sheet1'!$A$1:$B$2 or 'Sheet1:Sheet2'!$A$1:$B$2 |
534 | - } elseif (preg_match("/^'".self::REGEX_SHEET_TITLE_QUOTED."(\:".self::REGEX_SHEET_TITLE_QUOTED.")?'\!\\$?([A-Ia-i]?[A-Za-z])?\\$?(\d+)\:\\$?([A-Ia-i]?[A-Za-z])?\\$?(\d+)$/u", $token)) { |
|
534 | + } elseif (preg_match("/^'" . self::REGEX_SHEET_TITLE_QUOTED . "(\:" . self::REGEX_SHEET_TITLE_QUOTED . ")?'\!\\$?([A-Ia-i]?[A-Za-z])?\\$?(\d+)\:\\$?([A-Ia-i]?[A-Za-z])?\\$?(\d+)$/u", $token)) { |
|
535 | 535 | return $this->convertRange3d($token); |
536 | 536 | // operators (including parentheses) |
537 | 537 | } elseif (isset($this->ptg[$token])) { |
@@ -587,7 +587,7 @@ discard block |
||
587 | 587 | throw new \PhpOffice\PhpSpreadsheet\Writer\WriteException('String is too long'); |
588 | 588 | } |
589 | 589 | |
590 | - return pack('C', $this->ptg['ptgStr']).\PhpOffice\PhpSpreadsheet\Shared\StringHelper::UTF8toBIFF8UnicodeShort($string); |
|
590 | + return pack('C', $this->ptg['ptgStr']) . \PhpOffice\PhpSpreadsheet\Shared\StringHelper::UTF8toBIFF8UnicodeShort($string); |
|
591 | 591 | } |
592 | 592 | |
593 | 593 | /** |
@@ -647,7 +647,7 @@ discard block |
||
647 | 647 | throw new \PhpOffice\PhpSpreadsheet\Writer\WriteException("Unknown class $class"); |
648 | 648 | } |
649 | 649 | |
650 | - return $ptgArea.$row1.$row2.$col1.$col2; |
|
650 | + return $ptgArea . $row1 . $row2 . $col1 . $col2; |
|
651 | 651 | } |
652 | 652 | |
653 | 653 | /** |
@@ -674,13 +674,13 @@ discard block |
||
674 | 674 | list($row1, $col1) = $this->cellToPackedRowcol($cell1); |
675 | 675 | list($row2, $col2) = $this->cellToPackedRowcol($cell2); |
676 | 676 | } else { // It's a rows range (like 26:27) |
677 | - list($row1, $col1, $row2, $col2) = $this->rangeToPackedRange($cell1.':'.$cell2); |
|
677 | + list($row1, $col1, $row2, $col2) = $this->rangeToPackedRange($cell1 . ':' . $cell2); |
|
678 | 678 | } |
679 | 679 | |
680 | 680 | // The ptg value depends on the class of the ptg. |
681 | 681 | $ptgArea = pack('C', $this->ptg['ptgArea3d']); |
682 | 682 | |
683 | - return $ptgArea.$ext_ref.$row1.$row2.$col1.$col2; |
|
683 | + return $ptgArea . $ext_ref . $row1 . $row2 . $col1 . $col2; |
|
684 | 684 | } |
685 | 685 | |
686 | 686 | /** |
@@ -699,7 +699,7 @@ discard block |
||
699 | 699 | // The ptg value depends on the class of the ptg. |
700 | 700 | $ptgRef = pack('C', $this->ptg['ptgRefA']); |
701 | 701 | |
702 | - return $ptgRef.$row.$col; |
|
702 | + return $ptgRef . $row . $col; |
|
703 | 703 | } |
704 | 704 | |
705 | 705 | /** |
@@ -724,7 +724,7 @@ discard block |
||
724 | 724 | // The ptg value depends on the class of the ptg. |
725 | 725 | $ptgRef = pack('C', $this->ptg['ptgRef3dA']); |
726 | 726 | |
727 | - return $ptgRef.$ext_ref.$row.$col; |
|
727 | + return $ptgRef . $ext_ref . $row . $col; |
|
728 | 728 | } |
729 | 729 | |
730 | 730 | /** |
@@ -1086,22 +1086,22 @@ discard block |
||
1086 | 1086 | // if it's a reference A1 or $A$1 or $A1 or A$1 |
1087 | 1087 | if (preg_match('/^\$?[A-Ia-i]?[A-Za-z]\$?[0-9]+$/', $token) and !preg_match('/[0-9]/', $this->lookAhead) and ($this->lookAhead != ':') and ($this->lookAhead != '.') and ($this->lookAhead != '!')) { |
1088 | 1088 | return $token; |
1089 | - } elseif (preg_match('/^'.self::REGEX_SHEET_TITLE_UNQUOTED."(\:".self::REGEX_SHEET_TITLE_UNQUOTED.")?\!\\$?[A-Ia-i]?[A-Za-z]\\$?[0-9]+$/u", $token) and !preg_match('/[0-9]/', $this->lookAhead) and ($this->lookAhead != ':') and ($this->lookAhead != '.')) { |
|
1089 | + } elseif (preg_match('/^' . self::REGEX_SHEET_TITLE_UNQUOTED . "(\:" . self::REGEX_SHEET_TITLE_UNQUOTED . ")?\!\\$?[A-Ia-i]?[A-Za-z]\\$?[0-9]+$/u", $token) and !preg_match('/[0-9]/', $this->lookAhead) and ($this->lookAhead != ':') and ($this->lookAhead != '.')) { |
|
1090 | 1090 | // If it's an external reference (Sheet1!A1 or Sheet1:Sheet2!A1 or Sheet1!$A$1 or Sheet1:Sheet2!$A$1) |
1091 | 1091 | return $token; |
1092 | - } elseif (preg_match("/^'".self::REGEX_SHEET_TITLE_QUOTED."(\:".self::REGEX_SHEET_TITLE_QUOTED.")?'\!\\$?[A-Ia-i]?[A-Za-z]\\$?[0-9]+$/u", $token) and !preg_match('/[0-9]/', $this->lookAhead) and ($this->lookAhead != ':') and ($this->lookAhead != '.')) { |
|
1092 | + } elseif (preg_match("/^'" . self::REGEX_SHEET_TITLE_QUOTED . "(\:" . self::REGEX_SHEET_TITLE_QUOTED . ")?'\!\\$?[A-Ia-i]?[A-Za-z]\\$?[0-9]+$/u", $token) and !preg_match('/[0-9]/', $this->lookAhead) and ($this->lookAhead != ':') and ($this->lookAhead != '.')) { |
|
1093 | 1093 | // If it's an external reference ('Sheet1'!A1 or 'Sheet1:Sheet2'!A1 or 'Sheet1'!$A$1 or 'Sheet1:Sheet2'!$A$1) |
1094 | 1094 | return $token; |
1095 | 1095 | } elseif (preg_match('/^(\$)?[A-Ia-i]?[A-Za-z](\$)?[0-9]+:(\$)?[A-Ia-i]?[A-Za-z](\$)?[0-9]+$/', $token) && !preg_match('/[0-9]/', $this->lookAhead)) { |
1096 | 1096 | // if it's a range A1:A2 or $A$1:$A$2 |
1097 | 1097 | return $token; |
1098 | - } elseif (preg_match('/^'.self::REGEX_SHEET_TITLE_UNQUOTED."(\:".self::REGEX_SHEET_TITLE_UNQUOTED.")?\!\\$?([A-Ia-i]?[A-Za-z])?\\$?[0-9]+:\\$?([A-Ia-i]?[A-Za-z])?\\$?[0-9]+$/u", $token) and !preg_match('/[0-9]/', $this->lookAhead)) { |
|
1098 | + } elseif (preg_match('/^' . self::REGEX_SHEET_TITLE_UNQUOTED . "(\:" . self::REGEX_SHEET_TITLE_UNQUOTED . ")?\!\\$?([A-Ia-i]?[A-Za-z])?\\$?[0-9]+:\\$?([A-Ia-i]?[A-Za-z])?\\$?[0-9]+$/u", $token) and !preg_match('/[0-9]/', $this->lookAhead)) { |
|
1099 | 1099 | // If it's an external range like Sheet1!A1:B2 or Sheet1:Sheet2!A1:B2 or Sheet1!$A$1:$B$2 or Sheet1:Sheet2!$A$1:$B$2 |
1100 | 1100 | return $token; |
1101 | - } elseif (preg_match("/^'".self::REGEX_SHEET_TITLE_QUOTED."(\:".self::REGEX_SHEET_TITLE_QUOTED.")?'\!\\$?([A-Ia-i]?[A-Za-z])?\\$?[0-9]+:\\$?([A-Ia-i]?[A-Za-z])?\\$?[0-9]+$/u", $token) and !preg_match('/[0-9]/', $this->lookAhead)) { |
|
1101 | + } elseif (preg_match("/^'" . self::REGEX_SHEET_TITLE_QUOTED . "(\:" . self::REGEX_SHEET_TITLE_QUOTED . ")?'\!\\$?([A-Ia-i]?[A-Za-z])?\\$?[0-9]+:\\$?([A-Ia-i]?[A-Za-z])?\\$?[0-9]+$/u", $token) and !preg_match('/[0-9]/', $this->lookAhead)) { |
|
1102 | 1102 | // If it's an external range like 'Sheet1'!A1:B2 or 'Sheet1:Sheet2'!A1:B2 or 'Sheet1'!$A$1:$B$2 or 'Sheet1:Sheet2'!$A$1:$B$2 |
1103 | 1103 | return $token; |
1104 | - } elseif (is_numeric($token) and (!is_numeric($token.$this->lookAhead) or ($this->lookAhead == '')) and ($this->lookAhead != '!') and ($this->lookAhead != ':')) { |
|
1104 | + } elseif (is_numeric($token) and (!is_numeric($token . $this->lookAhead) or ($this->lookAhead == '')) and ($this->lookAhead != '!') and ($this->lookAhead != ':')) { |
|
1105 | 1105 | // If it's a number (check that it's not a sheet name or range) |
1106 | 1106 | return $token; |
1107 | 1107 | } elseif (preg_match('/"([^"]|""){0,255}"/', $token) and $this->lookAhead != '"' and (substr_count($token, '"') % 2 == 0)) { |
@@ -1320,13 +1320,13 @@ discard block |
||
1320 | 1320 | $this->advance(); |
1321 | 1321 | |
1322 | 1322 | return $result; |
1323 | - } elseif (preg_match('/^'.self::REGEX_SHEET_TITLE_UNQUOTED."(\:".self::REGEX_SHEET_TITLE_UNQUOTED.")?\!\\$?[A-Ia-i]?[A-Za-z]\\$?[0-9]+$/u", $this->currentToken)) { |
|
1323 | + } elseif (preg_match('/^' . self::REGEX_SHEET_TITLE_UNQUOTED . "(\:" . self::REGEX_SHEET_TITLE_UNQUOTED . ")?\!\\$?[A-Ia-i]?[A-Za-z]\\$?[0-9]+$/u", $this->currentToken)) { |
|
1324 | 1324 | // If it's an external reference (Sheet1!A1 or Sheet1:Sheet2!A1 or Sheet1!$A$1 or Sheet1:Sheet2!$A$1) |
1325 | 1325 | $result = $this->createTree($this->currentToken, '', ''); |
1326 | 1326 | $this->advance(); |
1327 | 1327 | |
1328 | 1328 | return $result; |
1329 | - } elseif (preg_match("/^'".self::REGEX_SHEET_TITLE_QUOTED."(\:".self::REGEX_SHEET_TITLE_QUOTED.")?'\!\\$?[A-Ia-i]?[A-Za-z]\\$?[0-9]+$/u", $this->currentToken)) { |
|
1329 | + } elseif (preg_match("/^'" . self::REGEX_SHEET_TITLE_QUOTED . "(\:" . self::REGEX_SHEET_TITLE_QUOTED . ")?'\!\\$?[A-Ia-i]?[A-Za-z]\\$?[0-9]+$/u", $this->currentToken)) { |
|
1330 | 1330 | // If it's an external reference ('Sheet1'!A1 or 'Sheet1:Sheet2'!A1 or 'Sheet1'!$A$1 or 'Sheet1:Sheet2'!$A$1) |
1331 | 1331 | $result = $this->createTree($this->currentToken, '', ''); |
1332 | 1332 | $this->advance(); |
@@ -1340,14 +1340,14 @@ discard block |
||
1340 | 1340 | $this->advance(); |
1341 | 1341 | |
1342 | 1342 | return $result; |
1343 | - } elseif (preg_match('/^'.self::REGEX_SHEET_TITLE_UNQUOTED."(\:".self::REGEX_SHEET_TITLE_UNQUOTED.")?\!\\$?([A-Ia-i]?[A-Za-z])?\\$?[0-9]+:\\$?([A-Ia-i]?[A-Za-z])?\\$?[0-9]+$/u", $this->currentToken)) { |
|
1343 | + } elseif (preg_match('/^' . self::REGEX_SHEET_TITLE_UNQUOTED . "(\:" . self::REGEX_SHEET_TITLE_UNQUOTED . ")?\!\\$?([A-Ia-i]?[A-Za-z])?\\$?[0-9]+:\\$?([A-Ia-i]?[A-Za-z])?\\$?[0-9]+$/u", $this->currentToken)) { |
|
1344 | 1344 | // If it's an external range (Sheet1!A1:B2 or Sheet1:Sheet2!A1:B2 or Sheet1!$A$1:$B$2 or Sheet1:Sheet2!$A$1:$B$2) |
1345 | 1345 | // must be an error? |
1346 | 1346 | $result = $this->createTree($this->currentToken, '', ''); |
1347 | 1347 | $this->advance(); |
1348 | 1348 | |
1349 | 1349 | return $result; |
1350 | - } elseif (preg_match("/^'".self::REGEX_SHEET_TITLE_QUOTED."(\:".self::REGEX_SHEET_TITLE_QUOTED.")?'\!\\$?([A-Ia-i]?[A-Za-z])?\\$?[0-9]+:\\$?([A-Ia-i]?[A-Za-z])?\\$?[0-9]+$/u", $this->currentToken)) { |
|
1350 | + } elseif (preg_match("/^'" . self::REGEX_SHEET_TITLE_QUOTED . "(\:" . self::REGEX_SHEET_TITLE_QUOTED . ")?'\!\\$?([A-Ia-i]?[A-Za-z])?\\$?[0-9]+:\\$?([A-Ia-i]?[A-Za-z])?\\$?[0-9]+$/u", $this->currentToken)) { |
|
1351 | 1351 | // If it's an external range ('Sheet1'!A1:B2 or 'Sheet1'!A1:B2 or 'Sheet1'!$A$1:$B$2 or 'Sheet1'!$A$1:$B$2) |
1352 | 1352 | // must be an error? |
1353 | 1353 | $result = $this->createTree($this->currentToken, '', ''); |
@@ -1371,7 +1371,7 @@ discard block |
||
1371 | 1371 | |
1372 | 1372 | return $result; |
1373 | 1373 | } |
1374 | - throw new \PhpOffice\PhpSpreadsheet\Writer\WriteException('Syntax error: '.$this->currentToken.', lookahead: '.$this->lookAhead.', current char: '.$this->currentCharacter); |
|
1374 | + throw new \PhpOffice\PhpSpreadsheet\Writer\WriteException('Syntax error: ' . $this->currentToken . ', lookahead: ' . $this->lookAhead . ', current char: ' . $this->currentCharacter); |
|
1375 | 1375 | } |
1376 | 1376 | |
1377 | 1377 | /** |
@@ -1492,7 +1492,7 @@ discard block |
||
1492 | 1492 | $left_tree = ''; |
1493 | 1493 | } |
1494 | 1494 | // add it's left subtree and return. |
1495 | - return $left_tree.$this->convertFunction($tree['value'], $tree['right']); |
|
1495 | + return $left_tree . $this->convertFunction($tree['value'], $tree['right']); |
|
1496 | 1496 | } else { |
1497 | 1497 | $converted_tree = $this->convert($tree['value']); |
1498 | 1498 | } |
@@ -242,6 +242,7 @@ discard block |
||
242 | 242 | * |
243 | 243 | * @param \PhpOffice\PhpSpreadsheet\Style |
244 | 244 | * @param bool Is it a style XF? |
245 | + * @param \PhpOffice\PhpSpreadsheet\Style $style |
|
245 | 246 | * |
246 | 247 | * @return int Index to XF record |
247 | 248 | */ |
@@ -796,7 +797,7 @@ discard block |
||
796 | 797 | * |
797 | 798 | * @param string $name The name in UTF-8 |
798 | 799 | * @param string $formulaData The binary formula data |
799 | - * @param string $sheetIndex 1-based sheet index the defined name applies to. 0 = global |
|
800 | + * @param integer $sheetIndex 1-based sheet index the defined name applies to. 0 = global |
|
800 | 801 | * @param bool $isBuiltIn Built-in name? |
801 | 802 | * |
802 | 803 | * @return string Complete binary record data |
@@ -657,7 +657,7 @@ discard block |
||
657 | 657 | // Create absolute coordinate |
658 | 658 | $range = \PhpOffice\PhpSpreadsheet\Cell::splitRange($namedRange->getRange()); |
659 | 659 | for ($i = 0; $i < count($range); ++$i) { |
660 | - $range[$i][0] = '\''.str_replace("'", "''", $namedRange->getWorksheet()->getTitle()).'\'!'.\PhpOffice\PhpSpreadsheet\Cell::absoluteCoordinate($range[$i][0]); |
|
660 | + $range[$i][0] = '\'' . str_replace("'", "''", $namedRange->getWorksheet()->getTitle()) . '\'!' . \PhpOffice\PhpSpreadsheet\Cell::absoluteCoordinate($range[$i][0]); |
|
661 | 661 | if (isset($range[$i][1])) { |
662 | 662 | $range[$i][1] = \PhpOffice\PhpSpreadsheet\Cell::absoluteCoordinate($range[$i][1]); |
663 | 663 | } |
@@ -671,7 +671,7 @@ discard block |
||
671 | 671 | |
672 | 672 | // make sure tRef3d is of type tRef3dR (0x3A) |
673 | 673 | if (isset($formulaData{0}) and ($formulaData{0} == "\x7A" or $formulaData{0} == "\x5A")) { |
674 | - $formulaData = "\x3A".substr($formulaData, 1); |
|
674 | + $formulaData = "\x3A" . substr($formulaData, 1); |
|
675 | 675 | } |
676 | 676 | |
677 | 677 | if ($namedRange->getLocalOnly()) { |
@@ -819,12 +819,12 @@ discard block |
||
819 | 819 | |
820 | 820 | // combine the parts |
821 | 821 | $data = pack('vCCvvvCCCC', $options, 0, $nlen, $sz, 0, $sheetIndex, 0, 0, 0, 0) |
822 | - .$name.$formulaData; |
|
822 | + .$name . $formulaData; |
|
823 | 823 | $length = strlen($data); |
824 | 824 | |
825 | 825 | $header = pack('vv', $record, $length); |
826 | 826 | |
827 | - return $header.$data; |
|
827 | + return $header . $data; |
|
828 | 828 | } |
829 | 829 | |
830 | 830 | /** |
@@ -859,12 +859,12 @@ discard block |
||
859 | 859 | |
860 | 860 | // combine the parts |
861 | 861 | $data = pack('vCCvvvCCCCC', $options, 0, 1, $sz, 0, $sheetIndex, 0, 0, 0, 0, 0) |
862 | - .$name.$extra; |
|
862 | + .$name . $extra; |
|
863 | 863 | $length = strlen($data); |
864 | 864 | |
865 | 865 | $header = pack('vv', $record, $length); |
866 | 866 | |
867 | - return $header.$data; |
|
867 | + return $header . $data; |
|
868 | 868 | } |
869 | 869 | |
870 | 870 | /** |
@@ -879,7 +879,7 @@ discard block |
||
879 | 879 | $header = pack('vv', $record, $length); |
880 | 880 | $data = pack('v', $cv); |
881 | 881 | |
882 | - $this->append($header.$data); |
|
882 | + $this->append($header . $data); |
|
883 | 883 | } |
884 | 884 | |
885 | 885 | /** |
@@ -908,7 +908,7 @@ discard block |
||
908 | 908 | |
909 | 909 | $header = pack('vv', $record, $length); |
910 | 910 | $data = pack('vvvvvvvvv', $xWn, $yWn, $dxWn, $dyWn, $grbit, $itabCur, $itabFirst, $ctabsel, $wTabRatio); |
911 | - $this->append($header.$data); |
|
911 | + $this->append($header . $data); |
|
912 | 912 | } |
913 | 913 | |
914 | 914 | /** |
@@ -948,7 +948,7 @@ discard block |
||
948 | 948 | |
949 | 949 | $length = strlen($data); |
950 | 950 | $header = pack('vv', $record, $length); |
951 | - $this->append($header.$data); |
|
951 | + $this->append($header . $data); |
|
952 | 952 | } |
953 | 953 | |
954 | 954 | /** |
@@ -962,7 +962,7 @@ discard block |
||
962 | 962 | $header = pack('vv', $record, $length); |
963 | 963 | $data = pack('vv', $this->spreadsheet->getSheetCount(), 0x0401); |
964 | 964 | |
965 | - return $this->writeData($header.$data); |
|
965 | + return $this->writeData($header . $data); |
|
966 | 966 | } |
967 | 967 | |
968 | 968 | /** |
@@ -982,7 +982,7 @@ discard block |
||
982 | 982 | $data .= $this->parser->references[$i]; |
983 | 983 | } |
984 | 984 | |
985 | - return $this->writeData($header.$data); |
|
985 | + return $this->writeData($header . $data); |
|
986 | 986 | } |
987 | 987 | |
988 | 988 | /** |
@@ -999,7 +999,7 @@ discard block |
||
999 | 999 | |
1000 | 1000 | $header = pack('vv', $record, $length); |
1001 | 1001 | $data = pack('vCC', $ixfe, $BuiltIn, $iLevel); |
1002 | - $this->append($header.$data); |
|
1002 | + $this->append($header . $data); |
|
1003 | 1003 | } |
1004 | 1004 | |
1005 | 1005 | /** |
@@ -1016,8 +1016,8 @@ discard block |
||
1016 | 1016 | $length = 2 + strlen($numberFormatString); // Number of bytes to follow |
1017 | 1017 | |
1018 | 1018 | $header = pack('vv', $record, $length); |
1019 | - $data = pack('v', $ifmt).$numberFormatString; |
|
1020 | - $this->append($header.$data); |
|
1019 | + $data = pack('v', $ifmt) . $numberFormatString; |
|
1020 | + $this->append($header . $data); |
|
1021 | 1021 | } |
1022 | 1022 | |
1023 | 1023 | /** |
@@ -1034,7 +1034,7 @@ discard block |
||
1034 | 1034 | |
1035 | 1035 | $header = pack('vv', $record, $length); |
1036 | 1036 | $data = pack('v', $f1904); |
1037 | - $this->append($header.$data); |
|
1037 | + $this->append($header . $data); |
|
1038 | 1038 | } |
1039 | 1039 | |
1040 | 1040 | /** |
@@ -1056,7 +1056,7 @@ discard block |
||
1056 | 1056 | |
1057 | 1057 | $header = pack('vv', $record, $length); |
1058 | 1058 | $data = pack('v', $cxals); |
1059 | - $this->append($header.$data); |
|
1059 | + $this->append($header . $data); |
|
1060 | 1060 | } |
1061 | 1061 | |
1062 | 1062 | /** |
@@ -1078,7 +1078,7 @@ discard block |
||
1078 | 1078 | |
1079 | 1079 | $header = pack('vv', $record, $length); |
1080 | 1080 | $data = pack('CC', $cch, $rgch); |
1081 | - $this->append($header.$data.$sheetname); |
|
1081 | + $this->append($header . $data . $sheetname); |
|
1082 | 1082 | } |
1083 | 1083 | |
1084 | 1084 | /** |
@@ -1140,7 +1140,7 @@ discard block |
||
1140 | 1140 | $data .= pack('v', $rowmax); |
1141 | 1141 | $data .= pack('C', $colmin); |
1142 | 1142 | $data .= pack('C', $colmax); |
1143 | - $this->append($header.$data); |
|
1143 | + $this->append($header . $data); |
|
1144 | 1144 | } |
1145 | 1145 | |
1146 | 1146 | /** |
@@ -1223,7 +1223,7 @@ discard block |
||
1223 | 1223 | $data .= pack('C', 0xff); |
1224 | 1224 | // End of data |
1225 | 1225 | $data .= pack('C', 0x10); |
1226 | - $this->append($header.$data); |
|
1226 | + $this->append($header . $data); |
|
1227 | 1227 | } |
1228 | 1228 | |
1229 | 1229 | /** |
@@ -1240,7 +1240,7 @@ discard block |
||
1240 | 1240 | /* using the same country code always for simplicity */ |
1241 | 1241 | $data = pack('vv', $this->countryCode, $this->countryCode); |
1242 | 1242 | |
1243 | - return $this->writeData($header.$data); |
|
1243 | + return $this->writeData($header . $data); |
|
1244 | 1244 | } |
1245 | 1245 | |
1246 | 1246 | /** |
@@ -1258,7 +1258,7 @@ discard block |
||
1258 | 1258 | // by inspection of real Excel files, MS Office Excel 2007 writes this |
1259 | 1259 | $data = pack('VV', 0x000001C1, 0x00001E667); |
1260 | 1260 | |
1261 | - return $this->writeData($header.$data); |
|
1261 | + return $this->writeData($header . $data); |
|
1262 | 1262 | } |
1263 | 1263 | |
1264 | 1264 | /** |
@@ -1281,7 +1281,7 @@ discard block |
||
1281 | 1281 | } |
1282 | 1282 | |
1283 | 1283 | $header = pack('vvv', $record, $length, $ccv); |
1284 | - $this->append($header.$data); |
|
1284 | + $this->append($header . $data); |
|
1285 | 1285 | } |
1286 | 1286 | |
1287 | 1287 | /** |
@@ -1401,7 +1401,7 @@ discard block |
||
1401 | 1401 | $record = ($i == 0) ? 0x00FC : 0x003C; |
1402 | 1402 | |
1403 | 1403 | $header = pack('vv', $record, strlen($recordData)); |
1404 | - $data = $header.$recordData; |
|
1404 | + $data = $header . $recordData; |
|
1405 | 1405 | |
1406 | 1406 | $chunk .= $this->writeData($data); |
1407 | 1407 | } |
@@ -1423,7 +1423,7 @@ discard block |
||
1423 | 1423 | $length = strlen($data); |
1424 | 1424 | $header = pack('vv', $record, $length); |
1425 | 1425 | |
1426 | - return $this->writeData($header.$data); |
|
1426 | + return $this->writeData($header . $data); |
|
1427 | 1427 | } else { |
1428 | 1428 | return ''; |
1429 | 1429 | } |
@@ -219,6 +219,8 @@ discard block |
||
219 | 219 | * @param bool $preCalculateFormulas Flag indicating whether formulas should be calculated or just written |
220 | 220 | * @param string $phpSheet The worksheet to write |
221 | 221 | * @param \PhpOffice\PhpSpreadsheet\Worksheet $phpSheet |
222 | + * @param integer $str_total |
|
223 | + * @param integer $str_unique |
|
222 | 224 | */ |
223 | 225 | public function __construct(&$str_total, &$str_unique, &$str_table, &$colors, $parser, $preCalculateFormulas, $phpSheet) |
224 | 226 | { |
@@ -620,7 +622,7 @@ discard block |
||
620 | 622 | * @param int $row Zero indexed row |
621 | 623 | * @param int $col Zero indexed column |
622 | 624 | * @param float $num The number to write |
623 | - * @param mixed $xfIndex The optional XF format |
|
625 | + * @param integer $xfIndex The optional XF format |
|
624 | 626 | * |
625 | 627 | * @return int |
626 | 628 | */ |
@@ -729,7 +731,7 @@ discard block |
||
729 | 731 | * @param int $row Zero indexed row |
730 | 732 | * @param int $col Zero indexed column |
731 | 733 | * @param string $str The string to write |
732 | - * @param mixed $xfIndex The XF format index for the cell |
|
734 | + * @param integer $xfIndex The XF format index for the cell |
|
733 | 735 | * |
734 | 736 | * @return int |
735 | 737 | */ |
@@ -796,7 +798,7 @@ discard block |
||
796 | 798 | * |
797 | 799 | * @param int $row Zero indexed row |
798 | 800 | * @param int $col Zero indexed column |
799 | - * @param mixed $xfIndex The XF format index |
|
801 | + * @param integer $xfIndex The XF format index |
|
800 | 802 | */ |
801 | 803 | public function writeBlank($row, $col, $xfIndex) |
802 | 804 | { |
@@ -843,7 +845,7 @@ discard block |
||
843 | 845 | * @param int $row Zero indexed row |
844 | 846 | * @param int $col Zero indexed column |
845 | 847 | * @param string $formula The formula text string |
846 | - * @param mixed $xfIndex The XF format index |
|
848 | + * @param integer $xfIndex The XF format index |
|
847 | 849 | * @param mixed $calculatedValue Calculated value |
848 | 850 | * |
849 | 851 | * @return int |
@@ -2323,8 +2325,8 @@ discard block |
||
2323 | 2325 | * @param mixed $bitmap The bitmap filename or GD-image resource |
2324 | 2326 | * @param int $x The horizontal position (offset) of the image inside the cell |
2325 | 2327 | * @param int $y The vertical position (offset) of the image inside the cell |
2326 | - * @param float $scale_x The horizontal scale |
|
2327 | - * @param float $scale_y The vertical scale |
|
2328 | + * @param integer $scale_x The horizontal scale |
|
2329 | + * @param integer $scale_y The vertical scale |
|
2328 | 2330 | */ |
2329 | 2331 | public function insertBitmap($row, $col, $bitmap, $x = 0, $y = 0, $scale_x = 1, $scale_y = 1) |
2330 | 2332 | { |
@@ -1171,14 +1171,14 @@ |
||
1171 | 1171 | |
1172 | 1172 | // Pack the main data stream |
1173 | 1173 | $data = pack('vvvv', $row1, $row2, $col1, $col2). |
1174 | - $unknown1. |
|
1175 | - $link_type. |
|
1176 | - $unknown2. |
|
1177 | - $up_count. |
|
1178 | - $dir_short_len. |
|
1179 | - $dir_short. |
|
1180 | - $unknown3. |
|
1181 | - $stream_len; /*. |
|
1174 | + $unknown1. |
|
1175 | + $link_type. |
|
1176 | + $unknown2. |
|
1177 | + $up_count. |
|
1178 | + $dir_short_len. |
|
1179 | + $dir_short. |
|
1180 | + $unknown3. |
|
1181 | + $stream_len; /*. |
|
1182 | 1182 | $dir_long_len . |
1183 | 1183 | $unknown4 . |
1184 | 1184 | $dir_long . |
@@ -490,7 +490,7 @@ discard block |
||
490 | 490 | // URL |
491 | 491 | } else { |
492 | 492 | // external (local file) |
493 | - $url = 'external:'.$url; |
|
493 | + $url = 'external:' . $url; |
|
494 | 494 | } |
495 | 495 | |
496 | 496 | $this->writeUrl($row - 1, \PhpOffice\PhpSpreadsheet\Cell::columnIndexFromString($column) - 1, $url); |
@@ -636,7 +636,7 @@ discard block |
||
636 | 636 | $xl_double = strrev($xl_double); |
637 | 637 | } |
638 | 638 | |
639 | - $this->append($header.$data.$xl_double); |
|
639 | + $this->append($header . $data . $xl_double); |
|
640 | 640 | |
641 | 641 | return 0; |
642 | 642 | } |
@@ -678,7 +678,7 @@ discard block |
||
678 | 678 | |
679 | 679 | $header = pack('vv', $record, $length); |
680 | 680 | $data = pack('vvvV', $row, $col, $xfIndex, $this->stringTable[$str]); |
681 | - $this->append($header.$data); |
|
681 | + $this->append($header . $data); |
|
682 | 682 | } |
683 | 683 | |
684 | 684 | /** |
@@ -713,7 +713,7 @@ discard block |
||
713 | 713 | |
714 | 714 | $header = pack('vv', $record, $length); |
715 | 715 | $data = pack('vvvv', $row, $col, $xfIndex, $strlen); |
716 | - $this->append($header.$data.$str); |
|
716 | + $this->append($header . $data . $str); |
|
717 | 717 | |
718 | 718 | return $str_error; |
719 | 719 | } |
@@ -748,7 +748,7 @@ discard block |
||
748 | 748 | |
749 | 749 | $header = pack('vv', $record, $length); |
750 | 750 | $data = pack('vvvV', $row, $col, $xfIndex, $this->stringTable[$str]); |
751 | - $this->append($header.$data); |
|
751 | + $this->append($header . $data); |
|
752 | 752 | } |
753 | 753 | |
754 | 754 | /** |
@@ -769,14 +769,14 @@ discard block |
||
769 | 769 | $length = 0x0006 + min($note_length, 2048); |
770 | 770 | $header = pack('vv', $record, $length); |
771 | 771 | $data = pack('vvv', $row, $col, $note_length); |
772 | - $this->append($header.$data.substr($note, 0, 2048)); |
|
772 | + $this->append($header . $data . substr($note, 0, 2048)); |
|
773 | 773 | |
774 | 774 | for ($i = $max_length; $i < $note_length; $i += $max_length) { |
775 | 775 | $chunk = substr($note, $i, $max_length); |
776 | 776 | $length = 0x0006 + strlen($chunk); |
777 | 777 | $header = pack('vv', $record, $length); |
778 | 778 | $data = pack('vvv', -1, 0, strlen($chunk)); |
779 | - $this->append($header.$data.$chunk); |
|
779 | + $this->append($header . $data . $chunk); |
|
780 | 780 | } |
781 | 781 | |
782 | 782 | return 0; |
@@ -805,7 +805,7 @@ discard block |
||
805 | 805 | |
806 | 806 | $header = pack('vv', $record, $length); |
807 | 807 | $data = pack('vvv', $row, $col, $xfIndex); |
808 | - $this->append($header.$data); |
|
808 | + $this->append($header . $data); |
|
809 | 809 | |
810 | 810 | return 0; |
811 | 811 | } |
@@ -826,7 +826,7 @@ discard block |
||
826 | 826 | |
827 | 827 | $header = pack('vv', $record, $length); |
828 | 828 | $data = pack('vvvCC', $row, $col, $xfIndex, $value, $isError); |
829 | - $this->append($header.$data); |
|
829 | + $this->append($header . $data); |
|
830 | 830 | |
831 | 831 | return 0; |
832 | 832 | } |
@@ -912,7 +912,7 @@ discard block |
||
912 | 912 | $data = pack('vvv', $row, $col, $xfIndex) |
913 | 913 | .$num |
914 | 914 | .pack('vVv', $grbit, $unknown, $formlen); |
915 | - $this->append($header.$data.$formula); |
|
915 | + $this->append($header . $data . $formula); |
|
916 | 916 | |
917 | 917 | // Append also a STRING record if necessary |
918 | 918 | if ($stringValue !== null) { |
@@ -938,7 +938,7 @@ discard block |
||
938 | 938 | $length = strlen($data); |
939 | 939 | $header = pack('vv', $record, $length); |
940 | 940 | |
941 | - $this->append($header.$data); |
|
941 | + $this->append($header . $data); |
|
942 | 942 | } |
943 | 943 | |
944 | 944 | /** |
@@ -1026,7 +1026,7 @@ discard block |
||
1026 | 1026 | |
1027 | 1027 | // Convert URL to a null terminated wchar string |
1028 | 1028 | $url = implode("\0", preg_split("''", $url, -1, PREG_SPLIT_NO_EMPTY)); |
1029 | - $url = $url."\0\0\0"; |
|
1029 | + $url = $url . "\0\0\0"; |
|
1030 | 1030 | |
1031 | 1031 | // Pack the length of the URL |
1032 | 1032 | $url_len = pack('V', strlen($url)); |
@@ -1039,7 +1039,7 @@ discard block |
||
1039 | 1039 | $data = pack('vvvv', $row1, $row2, $col1, $col2); |
1040 | 1040 | |
1041 | 1041 | // Write the packed data |
1042 | - $this->append($header.$data.$unknown1.$options.$unknown2.$url_len.$url); |
|
1042 | + $this->append($header . $data . $unknown1 . $options . $unknown2 . $url_len . $url); |
|
1043 | 1043 | |
1044 | 1044 | return 0; |
1045 | 1045 | } |
@@ -1088,7 +1088,7 @@ discard block |
||
1088 | 1088 | $data = pack('vvvv', $row1, $row2, $col1, $col2); |
1089 | 1089 | |
1090 | 1090 | // Write the packed data |
1091 | - $this->append($header.$data.$unknown1.$options.$url_len.$url); |
|
1091 | + $this->append($header . $data . $unknown1 . $options . $url_len . $url); |
|
1092 | 1092 | |
1093 | 1093 | return 0; |
1094 | 1094 | } |
@@ -1153,10 +1153,10 @@ discard block |
||
1153 | 1153 | $up_count = pack('v', $up_count); |
1154 | 1154 | |
1155 | 1155 | // Store the short dos dir name (null terminated) |
1156 | - $dir_short = preg_replace("/\.\.\\\/", '', $dir_long)."\0"; |
|
1156 | + $dir_short = preg_replace("/\.\.\\\/", '', $dir_long) . "\0"; |
|
1157 | 1157 | |
1158 | 1158 | // Store the long dir name as a wchar string (non-null terminated) |
1159 | - $dir_long = $dir_long."\0"; |
|
1159 | + $dir_long = $dir_long . "\0"; |
|
1160 | 1160 | |
1161 | 1161 | // Pack the lengths of the dir strings |
1162 | 1162 | $dir_short_len = pack('V', strlen($dir_short)); |
@@ -1170,14 +1170,14 @@ discard block |
||
1170 | 1170 | $unknown4 = pack('v', 0x03); |
1171 | 1171 | |
1172 | 1172 | // Pack the main data stream |
1173 | - $data = pack('vvvv', $row1, $row2, $col1, $col2). |
|
1174 | - $unknown1. |
|
1175 | - $link_type. |
|
1176 | - $unknown2. |
|
1177 | - $up_count. |
|
1178 | - $dir_short_len. |
|
1179 | - $dir_short. |
|
1180 | - $unknown3. |
|
1173 | + $data = pack('vvvv', $row1, $row2, $col1, $col2) . |
|
1174 | + $unknown1 . |
|
1175 | + $link_type . |
|
1176 | + $unknown2 . |
|
1177 | + $up_count . |
|
1178 | + $dir_short_len . |
|
1179 | + $dir_short . |
|
1180 | + $unknown3 . |
|
1181 | 1181 | $stream_len; /*. |
1182 | 1182 | $dir_long_len . |
1183 | 1183 | $unknown4 . |
@@ -1190,7 +1190,7 @@ discard block |
||
1190 | 1190 | $header = pack('vv', $record, $length); |
1191 | 1191 | |
1192 | 1192 | // Write the packed data |
1193 | - $this->append($header.$data); |
|
1193 | + $this->append($header . $data); |
|
1194 | 1194 | |
1195 | 1195 | return 0; |
1196 | 1196 | } |
@@ -1248,7 +1248,7 @@ discard block |
||
1248 | 1248 | |
1249 | 1249 | $header = pack('vv', $record, $length); |
1250 | 1250 | $data = pack('vvvvvvvv', $row, $colMic, $colMac, $miyRw, $irwMac, $reserved, $grbit, $ixfe); |
1251 | - $this->append($header.$data); |
|
1251 | + $this->append($header . $data); |
|
1252 | 1252 | } |
1253 | 1253 | |
1254 | 1254 | /** |
@@ -1262,7 +1262,7 @@ discard block |
||
1262 | 1262 | $data = pack('VVvvv', $this->firstRowIndex, $this->lastRowIndex + 1, $this->firstColumnIndex, $this->lastColumnIndex + 1, 0x0000); // reserved |
1263 | 1263 | |
1264 | 1264 | $header = pack('vv', $record, $length); |
1265 | - $this->append($header.$data); |
|
1265 | + $this->append($header . $data); |
|
1266 | 1266 | } |
1267 | 1267 | |
1268 | 1268 | /** |
@@ -1315,7 +1315,7 @@ discard block |
||
1315 | 1315 | |
1316 | 1316 | $data .= pack('vvvvV', $rgbHdr, 0x0000, $zoom_factor_page_break, $zoom_factor_normal, 0x00000000); |
1317 | 1317 | |
1318 | - $this->append($header.$data); |
|
1318 | + $this->append($header . $data); |
|
1319 | 1319 | } |
1320 | 1320 | |
1321 | 1321 | /** |
@@ -1337,7 +1337,7 @@ discard block |
||
1337 | 1337 | |
1338 | 1338 | $header = pack('vv', $record, $length); |
1339 | 1339 | $data = pack('vv', 1, $defaultRowHeight); |
1340 | - $this->append($header.$data); |
|
1340 | + $this->append($header . $data); |
|
1341 | 1341 | } |
1342 | 1342 | |
1343 | 1343 | /** |
@@ -1352,7 +1352,7 @@ discard block |
||
1352 | 1352 | |
1353 | 1353 | $header = pack('vv', $record, $length); |
1354 | 1354 | $data = pack('v', $defaultColWidth); |
1355 | - $this->append($header.$data); |
|
1355 | + $this->append($header . $data); |
|
1356 | 1356 | } |
1357 | 1357 | |
1358 | 1358 | /** |
@@ -1410,7 +1410,7 @@ discard block |
||
1410 | 1410 | |
1411 | 1411 | $header = pack('vv', $record, $length); |
1412 | 1412 | $data = pack('vvvvvv', $colFirst, $colLast, $coldx, $ixfe, $grbit, $reserved); |
1413 | - $this->append($header.$data); |
|
1413 | + $this->append($header . $data); |
|
1414 | 1414 | } |
1415 | 1415 | |
1416 | 1416 | /** |
@@ -1471,7 +1471,7 @@ discard block |
||
1471 | 1471 | |
1472 | 1472 | $header = pack('vv', $record, $length); |
1473 | 1473 | $data = pack('CvvvvvvCC', $pnn, $rwAct, $colAct, $irefAct, $cref, $rwFirst, $rwLast, $colFirst, $colLast); |
1474 | - $this->append($header.$data); |
|
1474 | + $this->append($header . $data); |
|
1475 | 1475 | } |
1476 | 1476 | |
1477 | 1477 | /** |
@@ -1516,10 +1516,10 @@ discard block |
||
1516 | 1516 | |
1517 | 1517 | // flush record if we have reached limit for number of merged cells, or reached final merged cell |
1518 | 1518 | if ($j == $maxCountMergeCellsPerRecord or $i == $countMergeCells) { |
1519 | - $recordData = pack('v', $j).$recordData; |
|
1519 | + $recordData = pack('v', $j) . $recordData; |
|
1520 | 1520 | $length = strlen($recordData); |
1521 | 1521 | $header = pack('vv', $record, $length); |
1522 | - $this->append($header.$recordData); |
|
1522 | + $this->append($header . $recordData); |
|
1523 | 1523 | |
1524 | 1524 | // initialize for next record, if any |
1525 | 1525 | $recordData = ''; |
@@ -1552,7 +1552,7 @@ discard block |
||
1552 | 1552 | |
1553 | 1553 | $record = 0x0862; // Record identifier |
1554 | 1554 | $header = pack('vv', $record, $length); |
1555 | - $this->append($header.$recordData); |
|
1555 | + $this->append($header . $recordData); |
|
1556 | 1556 | } |
1557 | 1557 | |
1558 | 1558 | /** |
@@ -1596,7 +1596,7 @@ discard block |
||
1596 | 1596 | $length = strlen($recordData); |
1597 | 1597 | $header = pack('vv', $record, $length); |
1598 | 1598 | |
1599 | - $this->append($header.$recordData); |
|
1599 | + $this->append($header . $recordData); |
|
1600 | 1600 | } |
1601 | 1601 | |
1602 | 1602 | /** |
@@ -1637,13 +1637,13 @@ discard block |
||
1637 | 1637 | hexdec($password) |
1638 | 1638 | ); |
1639 | 1639 | |
1640 | - $recordData .= \PhpOffice\PhpSpreadsheet\Shared\StringHelper::UTF8toBIFF8UnicodeLong('p'.md5($recordData)); |
|
1640 | + $recordData .= \PhpOffice\PhpSpreadsheet\Shared\StringHelper::UTF8toBIFF8UnicodeLong('p' . md5($recordData)); |
|
1641 | 1641 | |
1642 | 1642 | $length = strlen($recordData); |
1643 | 1643 | |
1644 | 1644 | $record = 0x0868; // Record identifier |
1645 | 1645 | $header = pack('vv', $record, $length); |
1646 | - $this->append($header.$recordData); |
|
1646 | + $this->append($header . $recordData); |
|
1647 | 1647 | } |
1648 | 1648 | } |
1649 | 1649 | |
@@ -1666,7 +1666,7 @@ discard block |
||
1666 | 1666 | |
1667 | 1667 | $header = pack('vv', $record, $length); |
1668 | 1668 | $data = pack('v', $count); |
1669 | - $this->append($header.$data); |
|
1669 | + $this->append($header . $data); |
|
1670 | 1670 | } |
1671 | 1671 | |
1672 | 1672 | /** |
@@ -1697,7 +1697,7 @@ discard block |
||
1697 | 1697 | |
1698 | 1698 | $header = pack('vv', $record, $length); |
1699 | 1699 | $data = pack('CC', $cch, $rgch); |
1700 | - $this->append($header.$data.$sheetname); |
|
1700 | + $this->append($header . $data . $sheetname); |
|
1701 | 1701 | } |
1702 | 1702 | |
1703 | 1703 | /** |
@@ -1779,7 +1779,7 @@ discard block |
||
1779 | 1779 | |
1780 | 1780 | $header = pack('vv', $record, $length); |
1781 | 1781 | $data = pack('vvvvv', $x, $y, $rwTop, $colLeft, $pnnAct); |
1782 | - $this->append($header.$data); |
|
1782 | + $this->append($header . $data); |
|
1783 | 1783 | } |
1784 | 1784 | |
1785 | 1785 | /** |
@@ -1838,9 +1838,9 @@ discard block |
||
1838 | 1838 | |
1839 | 1839 | $header = pack('vv', $record, $length); |
1840 | 1840 | $data1 = pack('vvvvvvvv', $iPaperSize, $iScale, $iPageStart, $iFitWidth, $iFitHeight, $grbit, $iRes, $iVRes); |
1841 | - $data2 = $numHdr.$numFtr; |
|
1841 | + $data2 = $numHdr . $numFtr; |
|
1842 | 1842 | $data3 = pack('v', $iCopies); |
1843 | - $this->append($header.$data1.$data2.$data3); |
|
1843 | + $this->append($header . $data1 . $data2 . $data3); |
|
1844 | 1844 | } |
1845 | 1845 | |
1846 | 1846 | /** |
@@ -1864,7 +1864,7 @@ discard block |
||
1864 | 1864 | |
1865 | 1865 | $header = pack('vv', $record, $length); |
1866 | 1866 | |
1867 | - $this->append($header.$recordData); |
|
1867 | + $this->append($header . $recordData); |
|
1868 | 1868 | } |
1869 | 1869 | |
1870 | 1870 | /** |
@@ -1888,7 +1888,7 @@ discard block |
||
1888 | 1888 | |
1889 | 1889 | $header = pack('vv', $record, $length); |
1890 | 1890 | |
1891 | - $this->append($header.$recordData); |
|
1891 | + $this->append($header . $recordData); |
|
1892 | 1892 | } |
1893 | 1893 | |
1894 | 1894 | /** |
@@ -1904,7 +1904,7 @@ discard block |
||
1904 | 1904 | $header = pack('vv', $record, $length); |
1905 | 1905 | $data = pack('v', $fHCenter); |
1906 | 1906 | |
1907 | - $this->append($header.$data); |
|
1907 | + $this->append($header . $data); |
|
1908 | 1908 | } |
1909 | 1909 | |
1910 | 1910 | /** |
@@ -1919,7 +1919,7 @@ discard block |
||
1919 | 1919 | |
1920 | 1920 | $header = pack('vv', $record, $length); |
1921 | 1921 | $data = pack('v', $fVCenter); |
1922 | - $this->append($header.$data); |
|
1922 | + $this->append($header . $data); |
|
1923 | 1923 | } |
1924 | 1924 | |
1925 | 1925 | /** |
@@ -1938,7 +1938,7 @@ discard block |
||
1938 | 1938 | $data = strrev($data); |
1939 | 1939 | } |
1940 | 1940 | |
1941 | - $this->append($header.$data); |
|
1941 | + $this->append($header . $data); |
|
1942 | 1942 | } |
1943 | 1943 | |
1944 | 1944 | /** |
@@ -1957,7 +1957,7 @@ discard block |
||
1957 | 1957 | $data = strrev($data); |
1958 | 1958 | } |
1959 | 1959 | |
1960 | - $this->append($header.$data); |
|
1960 | + $this->append($header . $data); |
|
1961 | 1961 | } |
1962 | 1962 | |
1963 | 1963 | /** |
@@ -1976,7 +1976,7 @@ discard block |
||
1976 | 1976 | $data = strrev($data); |
1977 | 1977 | } |
1978 | 1978 | |
1979 | - $this->append($header.$data); |
|
1979 | + $this->append($header . $data); |
|
1980 | 1980 | } |
1981 | 1981 | |
1982 | 1982 | /** |
@@ -1995,7 +1995,7 @@ discard block |
||
1995 | 1995 | $data = strrev($data); |
1996 | 1996 | } |
1997 | 1997 | |
1998 | - $this->append($header.$data); |
|
1998 | + $this->append($header . $data); |
|
1999 | 1999 | } |
2000 | 2000 | |
2001 | 2001 | /** |
@@ -2010,7 +2010,7 @@ discard block |
||
2010 | 2010 | |
2011 | 2011 | $header = pack('vv', $record, $length); |
2012 | 2012 | $data = pack('v', $fPrintRwCol); |
2013 | - $this->append($header.$data); |
|
2013 | + $this->append($header . $data); |
|
2014 | 2014 | } |
2015 | 2015 | |
2016 | 2016 | /** |
@@ -2026,7 +2026,7 @@ discard block |
||
2026 | 2026 | |
2027 | 2027 | $header = pack('vv', $record, $length); |
2028 | 2028 | $data = pack('v', $fPrintGrid); |
2029 | - $this->append($header.$data); |
|
2029 | + $this->append($header . $data); |
|
2030 | 2030 | } |
2031 | 2031 | |
2032 | 2032 | /** |
@@ -2042,7 +2042,7 @@ discard block |
||
2042 | 2042 | |
2043 | 2043 | $header = pack('vv', $record, $length); |
2044 | 2044 | $data = pack('v', $fGridSet); |
2045 | - $this->append($header.$data); |
|
2045 | + $this->append($header . $data); |
|
2046 | 2046 | } |
2047 | 2047 | |
2048 | 2048 | /** |
@@ -2058,7 +2058,7 @@ discard block |
||
2058 | 2058 | |
2059 | 2059 | $header = pack('vv', $record, $length); |
2060 | 2060 | $data = pack('v', $iNumFilters); |
2061 | - $this->append($header.$data); |
|
2061 | + $this->append($header . $data); |
|
2062 | 2062 | } |
2063 | 2063 | |
2064 | 2064 | /** |
@@ -2105,7 +2105,7 @@ discard block |
||
2105 | 2105 | $header = pack('vv', $record, $length); |
2106 | 2106 | $data = pack('vvvv', $dxRwGut, $dxColGut, $maxRowOutlineLevel, $col_level); |
2107 | 2107 | |
2108 | - $this->append($header.$data); |
|
2108 | + $this->append($header . $data); |
|
2109 | 2109 | } |
2110 | 2110 | |
2111 | 2111 | /** |
@@ -2141,7 +2141,7 @@ discard block |
||
2141 | 2141 | |
2142 | 2142 | $header = pack('vv', $record, $length); |
2143 | 2143 | $data = pack('v', $grbit); |
2144 | - $this->append($header.$data); |
|
2144 | + $this->append($header . $data); |
|
2145 | 2145 | } |
2146 | 2146 | |
2147 | 2147 | /** |
@@ -2194,7 +2194,7 @@ discard block |
||
2194 | 2194 | $data .= pack('vvv', $hbreak, 0x0000, 0x00ff); |
2195 | 2195 | } |
2196 | 2196 | |
2197 | - $this->append($header.$data); |
|
2197 | + $this->append($header . $data); |
|
2198 | 2198 | } |
2199 | 2199 | |
2200 | 2200 | // vertical page breaks |
@@ -2221,7 +2221,7 @@ discard block |
||
2221 | 2221 | $data .= pack('vvv', $vbreak, 0x0000, 0xffff); |
2222 | 2222 | } |
2223 | 2223 | |
2224 | - $this->append($header.$data); |
|
2224 | + $this->append($header . $data); |
|
2225 | 2225 | } |
2226 | 2226 | } |
2227 | 2227 | |
@@ -2243,7 +2243,7 @@ discard block |
||
2243 | 2243 | $header = pack('vv', $record, $length); |
2244 | 2244 | $data = pack('v', $fLock); |
2245 | 2245 | |
2246 | - $this->append($header.$data); |
|
2246 | + $this->append($header . $data); |
|
2247 | 2247 | } |
2248 | 2248 | |
2249 | 2249 | /** |
@@ -2267,7 +2267,7 @@ discard block |
||
2267 | 2267 | $header = pack('vv', $record, $length); |
2268 | 2268 | $data = pack('v', 1); |
2269 | 2269 | |
2270 | - $this->append($header.$data); |
|
2270 | + $this->append($header . $data); |
|
2271 | 2271 | } |
2272 | 2272 | |
2273 | 2273 | /** |
@@ -2291,7 +2291,7 @@ discard block |
||
2291 | 2291 | $header = pack('vv', $record, $length); |
2292 | 2292 | $data = pack('v', 1); |
2293 | 2293 | |
2294 | - $this->append($header.$data); |
|
2294 | + $this->append($header . $data); |
|
2295 | 2295 | } |
2296 | 2296 | |
2297 | 2297 | /** |
@@ -2312,7 +2312,7 @@ discard block |
||
2312 | 2312 | $header = pack('vv', $record, $length); |
2313 | 2313 | $data = pack('v', $wPassword); |
2314 | 2314 | |
2315 | - $this->append($header.$data); |
|
2315 | + $this->append($header . $data); |
|
2316 | 2316 | } |
2317 | 2317 | |
2318 | 2318 | /** |
@@ -2346,7 +2346,7 @@ discard block |
||
2346 | 2346 | $lcb = $size; |
2347 | 2347 | |
2348 | 2348 | $header = pack('vvvvV', $record, $length, $cf, $env, $lcb); |
2349 | - $this->append($header.$data); |
|
2349 | + $this->append($header . $data); |
|
2350 | 2350 | } |
2351 | 2351 | |
2352 | 2352 | /** |
@@ -2528,7 +2528,7 @@ discard block |
||
2528 | 2528 | $data .= pack('v', $grbit2); |
2529 | 2529 | $data .= pack('V', $Reserved5); |
2530 | 2530 | |
2531 | - $this->append($header.$data); |
|
2531 | + $this->append($header . $data); |
|
2532 | 2532 | } |
2533 | 2533 | |
2534 | 2534 | /** |
@@ -2550,7 +2550,7 @@ discard block |
||
2550 | 2550 | foreach (['red', 'green', 'blue'] as $key) { |
2551 | 2551 | $color[$key] = $color[$key] + round((255 - $color[$key]) * $color['alpha'] / 127); |
2552 | 2552 | } |
2553 | - $data .= chr($color['blue']).chr($color['green']).chr($color['red']); |
|
2553 | + $data .= chr($color['blue']) . chr($color['green']) . chr($color['red']); |
|
2554 | 2554 | } |
2555 | 2555 | if (3 * $width % 4) { |
2556 | 2556 | $data .= str_repeat("\x00", 4 - 3 * $width % 4); |
@@ -2641,7 +2641,7 @@ discard block |
||
2641 | 2641 | |
2642 | 2642 | // Add the BITMAPCOREHEADER data |
2643 | 2643 | $header = pack('Vvvvv', 0x000c, $width, $height, 0x01, 0x18); |
2644 | - $data = $header.$data; |
|
2644 | + $data = $header . $data; |
|
2645 | 2645 | |
2646 | 2646 | return [$width, $height, $size, $data]; |
2647 | 2647 | } |
@@ -2662,7 +2662,7 @@ discard block |
||
2662 | 2662 | |
2663 | 2663 | $header = pack('vv', $record, $length); |
2664 | 2664 | $data = pack('vv', $this->phpSheet->getSheetView()->getZoomScale(), 100); |
2665 | - $this->append($header.$data); |
|
2665 | + $this->append($header . $data); |
|
2666 | 2666 | } |
2667 | 2667 | |
2668 | 2668 | /** |
@@ -2711,7 +2711,7 @@ discard block |
||
2711 | 2711 | $length = strlen($dataChunk); |
2712 | 2712 | $header = pack('vv', $record, $length); |
2713 | 2713 | |
2714 | - $this->append($header.$dataChunk); |
|
2714 | + $this->append($header . $dataChunk); |
|
2715 | 2715 | |
2716 | 2716 | // OBJ record |
2717 | 2717 | $record = 0x005D; // record identifier |
@@ -2765,7 +2765,7 @@ discard block |
||
2765 | 2765 | |
2766 | 2766 | $length = strlen($objData); |
2767 | 2767 | $header = pack('vv', $record, $length); |
2768 | - $this->append($header.$objData); |
|
2768 | + $this->append($header . $objData); |
|
2769 | 2769 | } |
2770 | 2770 | } |
2771 | 2771 | } |
@@ -2791,7 +2791,7 @@ discard block |
||
2791 | 2791 | |
2792 | 2792 | $header = pack('vv', $record, $length); |
2793 | 2793 | $data = pack('vVVVV', $grbit, $horPos, $verPos, $objId, count($dataValidationCollection)); |
2794 | - $this->append($header.$data); |
|
2794 | + $this->append($header . $data); |
|
2795 | 2795 | |
2796 | 2796 | // DATAVALIDATION records |
2797 | 2797 | $record = 0x01BE; // Record identifier |
@@ -2956,7 +2956,7 @@ discard block |
||
2956 | 2956 | $length = strlen($data); |
2957 | 2957 | $header = pack('vv', $record, $length); |
2958 | 2958 | |
2959 | - $this->append($header.$data); |
|
2959 | + $this->append($header . $data); |
|
2960 | 2960 | } |
2961 | 2961 | } |
2962 | 2962 | } |
@@ -3018,7 +3018,7 @@ discard block |
||
3018 | 3018 | |
3019 | 3019 | $header = pack('vv', $record, $length); |
3020 | 3020 | $data = pack('vvVVvv', $rt, $grbitFrt, 0x00000000, 0x00000000, $wScalvePLV, $grbit); |
3021 | - $this->append($header.$data); |
|
3021 | + $this->append($header . $data); |
|
3022 | 3022 | } |
3023 | 3023 | |
3024 | 3024 | /** |
@@ -4196,7 +4196,7 @@ discard block |
||
4196 | 4196 | $data .= $operand2; |
4197 | 4197 | } |
4198 | 4198 | $header = pack('vv', $record, strlen($data)); |
4199 | - $this->append($header.$data); |
|
4199 | + $this->append($header . $data); |
|
4200 | 4200 | } |
4201 | 4201 | |
4202 | 4202 | /** |
@@ -4247,6 +4247,6 @@ discard block |
||
4247 | 4247 | $data .= $cellRange; |
4248 | 4248 | $data .= pack('v', 0x0001); |
4249 | 4249 | $data .= $cellRange; |
4250 | - $this->append($header.$data); |
|
4250 | + $this->append($header . $data); |
|
4251 | 4251 | } |
4252 | 4252 | } |
@@ -61,8 +61,8 @@ discard block |
||
61 | 61 | $this->currentObject->detach(); |
62 | 62 | |
63 | 63 | $obj = serialize($this->currentObject); |
64 | - if (!$this->memcache->replace($this->cachePrefix.$this->currentObjectID.'.cache', $obj, null, $this->cacheTime)) { |
|
65 | - if (!$this->memcache->add($this->cachePrefix.$this->currentObjectID.'.cache', $obj, null, $this->cacheTime)) { |
|
64 | + if (!$this->memcache->replace($this->cachePrefix . $this->currentObjectID . '.cache', $obj, null, $this->cacheTime)) { |
|
65 | + if (!$this->memcache->add($this->cachePrefix . $this->currentObjectID . '.cache', $obj, null, $this->cacheTime)) { |
|
66 | 66 | $this->__destruct(); |
67 | 67 | throw new \PhpOffice\PhpSpreadsheet\Exception("Failed to store cell {$this->currentObjectID} in MemCache"); |
68 | 68 | } |
@@ -113,11 +113,11 @@ discard block |
||
113 | 113 | return true; |
114 | 114 | } |
115 | 115 | // Check if the requested entry still exists in Memcache |
116 | - $success = $this->memcache->get($this->cachePrefix.$pCoord.'.cache'); |
|
116 | + $success = $this->memcache->get($this->cachePrefix . $pCoord . '.cache'); |
|
117 | 117 | if ($success === false) { |
118 | 118 | // Entry no longer exists in Memcache, so clear it from the cache array |
119 | 119 | parent::deleteCacheData($pCoord); |
120 | - throw new \PhpOffice\PhpSpreadsheet\Exception('Cell entry '.$pCoord.' no longer exists in MemCache'); |
|
120 | + throw new \PhpOffice\PhpSpreadsheet\Exception('Cell entry ' . $pCoord . ' no longer exists in MemCache'); |
|
121 | 121 | } |
122 | 122 | |
123 | 123 | return true; |
@@ -144,7 +144,7 @@ discard block |
||
144 | 144 | |
145 | 145 | // Check if the entry that has been requested actually exists |
146 | 146 | if (parent::isDataSet($pCoord)) { |
147 | - $obj = $this->memcache->get($this->cachePrefix.$pCoord.'.cache'); |
|
147 | + $obj = $this->memcache->get($this->cachePrefix . $pCoord . '.cache'); |
|
148 | 148 | if ($obj === false) { |
149 | 149 | // Entry no longer exists in Memcache, so clear it from the cache array |
150 | 150 | parent::deleteCacheData($pCoord); |
@@ -189,7 +189,7 @@ discard block |
||
189 | 189 | public function deleteCacheData($pCoord) |
190 | 190 | { |
191 | 191 | // Delete the entry from Memcache |
192 | - $this->memcache->delete($this->cachePrefix.$pCoord.'.cache'); |
|
192 | + $this->memcache->delete($this->cachePrefix . $pCoord . '.cache'); |
|
193 | 193 | |
194 | 194 | // Delete the entry from our cell address array |
195 | 195 | parent::deleteCacheData($pCoord); |
@@ -207,17 +207,17 @@ discard block |
||
207 | 207 | parent::copyCellCollection($parent); |
208 | 208 | // Get a new id for the new file name |
209 | 209 | $baseUnique = $this->getUniqueID(); |
210 | - $newCachePrefix = substr(md5($baseUnique), 0, 8).'.'; |
|
210 | + $newCachePrefix = substr(md5($baseUnique), 0, 8) . '.'; |
|
211 | 211 | $cacheList = $this->getCellList(); |
212 | 212 | foreach ($cacheList as $cellID) { |
213 | 213 | if ($cellID != $this->currentObjectID) { |
214 | - $obj = $this->memcache->get($this->cachePrefix.$cellID.'.cache'); |
|
214 | + $obj = $this->memcache->get($this->cachePrefix . $cellID . '.cache'); |
|
215 | 215 | if ($obj === false) { |
216 | 216 | // Entry no longer exists in Memcache, so clear it from the cache array |
217 | 217 | parent::deleteCacheData($cellID); |
218 | 218 | throw new \PhpOffice\PhpSpreadsheet\Exception("Cell entry {$cellID} no longer exists in MemCache"); |
219 | 219 | } |
220 | - if (!$this->memcache->add($newCachePrefix.$cellID.'.cache', $obj, null, $this->cacheTime)) { |
|
220 | + if (!$this->memcache->add($newCachePrefix . $cellID . '.cache', $obj, null, $this->cacheTime)) { |
|
221 | 221 | $this->__destruct(); |
222 | 222 | throw new \PhpOffice\PhpSpreadsheet\Exception("Failed to store cell {$cellID} in MemCache"); |
223 | 223 | } |
@@ -261,7 +261,7 @@ discard block |
||
261 | 261 | |
262 | 262 | if (is_null($this->cachePrefix)) { |
263 | 263 | $baseUnique = $this->getUniqueID(); |
264 | - $this->cachePrefix = substr(md5($baseUnique), 0, 8).'.'; |
|
264 | + $this->cachePrefix = substr(md5($baseUnique), 0, 8) . '.'; |
|
265 | 265 | |
266 | 266 | // Set a new Memcache object and connect to the Memcache server |
267 | 267 | $this->memcache = new \Memcache(); |
@@ -294,7 +294,7 @@ discard block |
||
294 | 294 | { |
295 | 295 | $cacheList = $this->getCellList(); |
296 | 296 | foreach ($cacheList as $cellID) { |
297 | - $this->memcache->delete($this->cachePrefix.$cellID.'.cache'); |
|
297 | + $this->memcache->delete($this->cachePrefix . $cellID . '.cache'); |
|
298 | 298 | } |
299 | 299 | } |
300 | 300 |
@@ -143,7 +143,7 @@ discard block |
||
143 | 143 | { |
144 | 144 | parent::copyCellCollection($parent); |
145 | 145 | // Open a new stream for the cell cache data |
146 | - $newFileHandle = fopen('php://temp/maxmemory:'.$this->memoryCacheSize, 'a+'); |
|
146 | + $newFileHandle = fopen('php://temp/maxmemory:' . $this->memoryCacheSize, 'a+'); |
|
147 | 147 | // Copy the existing cell cache data to the new stream |
148 | 148 | fseek($this->fileHandle, 0); |
149 | 149 | while (!feof($this->fileHandle)) { |
@@ -182,7 +182,7 @@ discard block |
||
182 | 182 | |
183 | 183 | parent::__construct($parent); |
184 | 184 | if (is_null($this->fileHandle)) { |
185 | - $this->fileHandle = fopen('php://temp/maxmemory:'.$this->memoryCacheSize, 'a+'); |
|
185 | + $this->fileHandle = fopen('php://temp/maxmemory:' . $this->memoryCacheSize, 'a+'); |
|
186 | 186 | } |
187 | 187 | } |
188 | 188 |