@@ -135,7 +135,7 @@ |
||
135 | 135 | /** |
136 | 136 | * Return the current cell in this worksheet column |
137 | 137 | * |
138 | - * @return Row |
|
138 | + * @return null|\PhpSpreadsheet\Cell |
|
139 | 139 | */ |
140 | 140 | public function current() |
141 | 141 | { |
@@ -229,7 +229,7 @@ |
||
229 | 229 | /** |
230 | 230 | * Set Color |
231 | 231 | * |
232 | - * @param \PhpSpreadsheet\Style_Color $pValue |
|
232 | + * @param \PhpSpreadsheet\Style\Color $pValue |
|
233 | 233 | * @throws \PhpSpreadsheet\Exception |
234 | 234 | * @return Shadow |
235 | 235 | */ |
@@ -311,7 +311,7 @@ |
||
311 | 311 | /** |
312 | 312 | * Write line to CSV file |
313 | 313 | * |
314 | - * @param mixed $pFileHandle PHP filehandle |
|
314 | + * @param resource $pFileHandle PHP filehandle |
|
315 | 315 | * @param array $pValues Array containing values in a row |
316 | 316 | * @throws Exception |
317 | 317 | */ |
@@ -116,10 +116,10 @@ |
||
116 | 116 | } |
117 | 117 | |
118 | 118 | if ($this->excelCompatibility) { |
119 | - $this->setUseBOM(true); // Enforce UTF-8 BOM Header |
|
120 | - $this->setIncludeSeparatorLine(true); // Set separator line |
|
121 | - $this->setEnclosure('"'); // Set enclosure to " |
|
122 | - $this->setDelimiter(';'); // Set delimiter to a semi-colon |
|
119 | + $this->setUseBOM(true); // Enforce UTF-8 BOM Header |
|
120 | + $this->setIncludeSeparatorLine(true); // Set separator line |
|
121 | + $this->setEnclosure('"'); // Set enclosure to " |
|
122 | + $this->setDelimiter(';'); // Set delimiter to a semi-colon |
|
123 | 123 | $this->setLineEnding("\r\n"); |
124 | 124 | } |
125 | 125 | if ($this->useBOM) { |
@@ -397,7 +397,7 @@ |
||
397 | 397 | /** |
398 | 398 | * Get PhpSpreadsheet object |
399 | 399 | * |
400 | - * @return PhpSpreadsheet |
|
400 | + * @return \PhpSpreadsheet\Spreadsheet |
|
401 | 401 | * @throws \PhpSpreadsheet\Writer\Exception |
402 | 402 | */ |
403 | 403 | public function getPhpSpreadsheet() |
@@ -138,8 +138,8 @@ |
||
138 | 138 | } |
139 | 139 | |
140 | 140 | $hashTablesArray = ['stylesConditionalHashTable', 'fillHashTable', 'fontHashTable', |
141 | - 'bordersHashTable', 'numFmtHashTable', 'drawingHashTable', |
|
142 | - 'styleHashTable', |
|
141 | + 'bordersHashTable', 'numFmtHashTable', 'drawingHashTable', |
|
142 | + 'styleHashTable', |
|
143 | 143 | ]; |
144 | 144 | |
145 | 145 | // Set HashTable variables |
@@ -137,8 +137,8 @@ discard block |
||
137 | 137 | $this->writerParts[$writer] = new $class($this); |
138 | 138 | } |
139 | 139 | |
140 | - $hashTablesArray = ['stylesConditionalHashTable', 'fillHashTable', 'fontHashTable', |
|
141 | - 'bordersHashTable', 'numFmtHashTable', 'drawingHashTable', |
|
140 | + $hashTablesArray = ['stylesConditionalHashTable', 'fillHashTable', 'fontHashTable', |
|
141 | + 'bordersHashTable', 'numFmtHashTable', 'drawingHashTable', |
|
142 | 142 | 'styleHashTable', |
143 | 143 | ]; |
144 | 144 | |
@@ -235,7 +235,7 @@ discard block |
||
235 | 235 | $macrosCode = $this->spreadSheet->getMacrosCode(); |
236 | 236 | if (!is_null($macrosCode)) { |
237 | 237 | // we have the code ? |
238 | - $objZip->addFromString('xl/vbaProject.bin', $macrosCode);//allways in 'xl', allways named vbaProject.bin |
|
238 | + $objZip->addFromString('xl/vbaProject.bin', $macrosCode); //allways in 'xl', allways named vbaProject.bin |
|
239 | 239 | if ($this->spreadSheet->hasMacrosCertificate()) { |
240 | 240 | //signed macros ? |
241 | 241 | // Yes : add the certificate file and the related rels file |
@@ -250,7 +250,7 @@ discard block |
||
250 | 250 | $objZip->addFromString($tmpRibbonTarget, $this->spreadSheet->getRibbonXMLData('data')); |
251 | 251 | if ($this->spreadSheet->hasRibbonBinObjects()) { |
252 | 252 | $tmpRootPath = dirname($tmpRibbonTarget) . '/'; |
253 | - $ribbonBinObjects = $this->spreadSheet->getRibbonBinObjects('data');//the files to write |
|
253 | + $ribbonBinObjects = $this->spreadSheet->getRibbonBinObjects('data'); //the files to write |
|
254 | 254 | foreach ($ribbonBinObjects as $aPath => $aContent) { |
255 | 255 | $objZip->addFromString($tmpRootPath . $aPath, $aContent); |
256 | 256 | } |
@@ -411,6 +411,8 @@ discard block |
||
411 | 411 | * @param string $id1 |
412 | 412 | * @param string $id2 |
413 | 413 | * @param boolean $isMultiLevelSeries |
414 | + * @param null|Axis $xAxis |
|
415 | + * @param null|Axis $yAxis |
|
414 | 416 | * |
415 | 417 | * @throws \PhpSpreadsheet\Writer\Exception |
416 | 418 | */ |
@@ -533,6 +535,10 @@ discard block |
||
533 | 535 | * @param string $id1 |
534 | 536 | * @param string $id2 |
535 | 537 | * @param boolean $isMultiLevelSeries |
538 | + * @param null|Axis $xAxis |
|
539 | + * @param null|Axis $yAxis |
|
540 | + * @param null|GridLines $majorGridlines |
|
541 | + * @param null|GridLines $minorGridlines |
|
536 | 542 | * |
537 | 543 | * @throws \PhpSpreadsheet\Writer\Exception |
538 | 544 | */ |
@@ -1259,7 +1265,6 @@ discard block |
||
1259 | 1265 | * @param \PhpSpreadsheet\Shared\XMLWriter $objWriter XML Writer |
1260 | 1266 | * @param string $groupType Type of plot for dataseries |
1261 | 1267 | * @param string $dataType Datatype of series values |
1262 | - * @param \PhpSpreadsheet\Worksheet $pSheet |
|
1263 | 1268 | * |
1264 | 1269 | * @throws \PhpSpreadsheet\Writer\Exception |
1265 | 1270 | */ |
@@ -191,7 +191,9 @@ discard block |
||
191 | 191 | * @param int &$str_unique Total number of unique strings |
192 | 192 | * @param array &$str_table String Table |
193 | 193 | * @param array &$colors Colour Table |
194 | - * @param mixed $parser The formula parser created for the Workbook |
|
194 | + * @param Parser $parser The formula parser created for the Workbook |
|
195 | + * @param integer $str_total |
|
196 | + * @param integer $str_unique |
|
195 | 197 | */ |
196 | 198 | public function __construct(\PhpSpreadsheet\Spreadsheet $spreadsheet, &$str_total, &$str_unique, &$str_table, &$colors, $parser) |
197 | 199 | { |
@@ -238,6 +240,7 @@ discard block |
||
238 | 240 | * |
239 | 241 | * @param \PhpSpreadsheet\Style |
240 | 242 | * @param boolean Is it a style XF? |
243 | + * @param \PhpSpreadsheet\Style $style |
|
241 | 244 | * @return int Index to XF record |
242 | 245 | */ |
243 | 246 | public function addXfWriter($style, $isStyleXf = false) |
@@ -790,7 +793,7 @@ discard block |
||
790 | 793 | * |
791 | 794 | * @param string $name The name in UTF-8 |
792 | 795 | * @param string $formulaData The binary formula data |
793 | - * @param string $sheetIndex 1-based sheet index the defined name applies to. 0 = global |
|
796 | + * @param integer $sheetIndex 1-based sheet index the defined name applies to. 0 = global |
|
794 | 797 | * @param boolean $isBuiltIn Built-in name? |
795 | 798 | * @return string Complete binary record data |
796 | 799 | */ |
@@ -219,11 +219,11 @@ discard block |
||
219 | 219 | for ($i = 0; $i < $countSheets; ++$i) { |
220 | 220 | $phpSheet = $spreadsheet->getSheet($i); |
221 | 221 | |
222 | - $this->parser->setExtSheet($phpSheet->getTitle(), $i); // Register worksheet name with parser |
|
222 | + $this->parser->setExtSheet($phpSheet->getTitle(), $i); // Register worksheet name with parser |
|
223 | 223 | |
224 | 224 | $supbook_index = 0x00; |
225 | 225 | $ref = pack('vvv', $supbook_index, $i, $i); |
226 | - $this->parser->references[] = $ref; // Register reference with parser |
|
226 | + $this->parser->references[] = $ref; // Register reference with parser |
|
227 | 227 | |
228 | 228 | // Sheet tab colors? |
229 | 229 | if ($phpSheet->isTabColorSet()) { |
@@ -467,7 +467,7 @@ discard block |
||
467 | 467 | */ |
468 | 468 | private function calcSheetOffsets() |
469 | 469 | { |
470 | - $boundsheet_length = 10; // fixed length for a BOUNDSHEET record |
|
470 | + $boundsheet_length = 10; // fixed length for a BOUNDSHEET record |
|
471 | 471 | |
472 | 472 | // size of Workbook globals part 1 + 3 |
473 | 473 | $offset = $this->_datasize; |
@@ -831,7 +831,7 @@ discard block |
||
831 | 831 | $record = 0x0018; |
832 | 832 | |
833 | 833 | // option flags |
834 | - $options = ($isHidden ? 0x21 : 0x00); |
|
834 | + $options = ($isHidden ? 0x21 : 0x00); |
|
835 | 835 | |
836 | 836 | $extra = pack( |
837 | 837 | 'Cvvvvv', |
@@ -861,9 +861,9 @@ discard block |
||
861 | 861 | */ |
862 | 862 | private function writeCodepage() |
863 | 863 | { |
864 | - $record = 0x0042; // Record identifier |
|
865 | - $length = 0x0002; // Number of bytes to follow |
|
866 | - $cv = $this->codepage; // The code page |
|
864 | + $record = 0x0042; // Record identifier |
|
865 | + $length = 0x0002; // Number of bytes to follow |
|
866 | + $cv = $this->codepage; // The code page |
|
867 | 867 | |
868 | 868 | $header = pack('vv', $record, $length); |
869 | 869 | $data = pack('v', $cv); |
@@ -876,24 +876,24 @@ discard block |
||
876 | 876 | */ |
877 | 877 | private function writeWindow1() |
878 | 878 | { |
879 | - $record = 0x003D; // Record identifier |
|
880 | - $length = 0x0012; // Number of bytes to follow |
|
879 | + $record = 0x003D; // Record identifier |
|
880 | + $length = 0x0012; // Number of bytes to follow |
|
881 | 881 | |
882 | - $xWn = 0x0000; // Horizontal position of window |
|
883 | - $yWn = 0x0000; // Vertical position of window |
|
884 | - $dxWn = 0x25BC; // Width of window |
|
885 | - $dyWn = 0x1572; // Height of window |
|
882 | + $xWn = 0x0000; // Horizontal position of window |
|
883 | + $yWn = 0x0000; // Vertical position of window |
|
884 | + $dxWn = 0x25BC; // Width of window |
|
885 | + $dyWn = 0x1572; // Height of window |
|
886 | 886 | |
887 | - $grbit = 0x0038; // Option flags |
|
887 | + $grbit = 0x0038; // Option flags |
|
888 | 888 | |
889 | 889 | // not supported by PhpSpreadsheet, so there is only one selected sheet, the active |
890 | - $ctabsel = 1; // Number of workbook tabs selected |
|
890 | + $ctabsel = 1; // Number of workbook tabs selected |
|
891 | 891 | |
892 | - $wTabRatio = 0x0258; // Tab to scrollbar ratio |
|
892 | + $wTabRatio = 0x0258; // Tab to scrollbar ratio |
|
893 | 893 | |
894 | 894 | // not supported by PhpSpreadsheet, set to 0 |
895 | - $itabFirst = 0; // 1st displayed worksheet |
|
896 | - $itabCur = $this->spreadsheet->getActiveSheetIndex(); // Active worksheet |
|
895 | + $itabFirst = 0; // 1st displayed worksheet |
|
896 | + $itabCur = $this->spreadsheet->getActiveSheetIndex(); // Active worksheet |
|
897 | 897 | |
898 | 898 | $header = pack('vv', $record, $length); |
899 | 899 | $data = pack('vvvvvvvvv', $xWn, $yWn, $dxWn, $dyWn, $grbit, $itabCur, $itabFirst, $ctabsel, $wTabRatio); |
@@ -909,7 +909,7 @@ discard block |
||
909 | 909 | private function writeBoundSheet($sheet, $offset) |
910 | 910 | { |
911 | 911 | $sheetname = $sheet->getTitle(); |
912 | - $record = 0x0085; // Record identifier |
|
912 | + $record = 0x0085; // Record identifier |
|
913 | 913 | |
914 | 914 | // sheet state |
915 | 915 | switch ($sheet->getSheetState()) { |
@@ -930,7 +930,7 @@ discard block |
||
930 | 930 | // sheet type |
931 | 931 | $st = 0x00; |
932 | 932 | |
933 | - $grbit = 0x0000; // Visibility and sheet type |
|
933 | + $grbit = 0x0000; // Visibility and sheet type |
|
934 | 934 | |
935 | 935 | $data = pack('VCC', $offset, $ss, $st); |
936 | 936 | $data .= \PhpSpreadsheet\Shared\StringHelper::UTF8toBIFF8UnicodeShort($sheetname); |
@@ -945,8 +945,8 @@ discard block |
||
945 | 945 | */ |
946 | 946 | private function writeSupbookInternal() |
947 | 947 | { |
948 | - $record = 0x01AE; // Record identifier |
|
949 | - $length = 0x0004; // Bytes to follow |
|
948 | + $record = 0x01AE; // Record identifier |
|
949 | + $length = 0x0004; // Bytes to follow |
|
950 | 950 | |
951 | 951 | $header = pack('vv', $record, $length); |
952 | 952 | $data = pack('vv', $this->spreadsheet->getSheetCount(), 0x0401); |
@@ -961,10 +961,10 @@ discard block |
||
961 | 961 | private function writeExternalsheetBiff8() |
962 | 962 | { |
963 | 963 | $totalReferences = count($this->parser->references); |
964 | - $record = 0x0017; // Record identifier |
|
965 | - $length = 2 + 6 * $totalReferences; // Number of bytes to follow |
|
964 | + $record = 0x0017; // Record identifier |
|
965 | + $length = 2 + 6 * $totalReferences; // Number of bytes to follow |
|
966 | 966 | |
967 | - $supbook_index = 0; // FIXME: only using internal SUPBOOK record |
|
967 | + $supbook_index = 0; // FIXME: only using internal SUPBOOK record |
|
968 | 968 | $header = pack('vv', $record, $length); |
969 | 969 | $data = pack('v', $totalReferences); |
970 | 970 | for ($i = 0; $i < $totalReferences; ++$i) { |
@@ -979,12 +979,12 @@ discard block |
||
979 | 979 | */ |
980 | 980 | private function writeStyle() |
981 | 981 | { |
982 | - $record = 0x0293; // Record identifier |
|
983 | - $length = 0x0004; // Bytes to follow |
|
982 | + $record = 0x0293; // Record identifier |
|
983 | + $length = 0x0004; // Bytes to follow |
|
984 | 984 | |
985 | - $ixfe = 0x8000; // Index to cell style XF |
|
986 | - $BuiltIn = 0x00; // Built-in style |
|
987 | - $iLevel = 0xff; // Outline style level |
|
985 | + $ixfe = 0x8000; // Index to cell style XF |
|
986 | + $BuiltIn = 0x00; // Built-in style |
|
987 | + $iLevel = 0xff; // Outline style level |
|
988 | 988 | |
989 | 989 | $header = pack('vv', $record, $length); |
990 | 990 | $data = pack('vCC', $ixfe, $BuiltIn, $iLevel); |
@@ -999,10 +999,10 @@ discard block |
||
999 | 999 | */ |
1000 | 1000 | private function writeNumberFormat($format, $ifmt) |
1001 | 1001 | { |
1002 | - $record = 0x041E; // Record identifier |
|
1002 | + $record = 0x041E; // Record identifier |
|
1003 | 1003 | |
1004 | 1004 | $numberFormatString = \PhpSpreadsheet\Shared\StringHelper::UTF8toBIFF8UnicodeLong($format); |
1005 | - $length = 2 + strlen($numberFormatString); // Number of bytes to follow |
|
1005 | + $length = 2 + strlen($numberFormatString); // Number of bytes to follow |
|
1006 | 1006 | |
1007 | 1007 | $header = pack('vv', $record, $length); |
1008 | 1008 | $data = pack('v', $ifmt) . $numberFormatString; |
@@ -1014,12 +1014,12 @@ discard block |
||
1014 | 1014 | */ |
1015 | 1015 | private function writeDateMode() |
1016 | 1016 | { |
1017 | - $record = 0x0022; // Record identifier |
|
1018 | - $length = 0x0002; // Bytes to follow |
|
1017 | + $record = 0x0022; // Record identifier |
|
1018 | + $length = 0x0002; // Bytes to follow |
|
1019 | 1019 | |
1020 | 1020 | $f1904 = (\PhpSpreadsheet\Shared\Date::getExcelCalendar() == \PhpSpreadsheet\Shared\Date::CALENDAR_MAC_1904) |
1021 | 1021 | ? 1 |
1022 | - : 0; // Flag for 1904 date system |
|
1022 | + : 0; // Flag for 1904 date system |
|
1023 | 1023 | |
1024 | 1024 | $header = pack('vv', $record, $length); |
1025 | 1025 | $data = pack('v', $f1904); |
@@ -1040,8 +1040,8 @@ discard block |
||
1040 | 1040 | */ |
1041 | 1041 | private function writeExternalCount($cxals) |
1042 | 1042 | { |
1043 | - $record = 0x0016; // Record identifier |
|
1044 | - $length = 0x0002; // Number of bytes to follow |
|
1043 | + $record = 0x0016; // Record identifier |
|
1044 | + $length = 0x0002; // Number of bytes to follow |
|
1045 | 1045 | |
1046 | 1046 | $header = pack('vv', $record, $length); |
1047 | 1047 | $data = pack('v', $cxals); |
@@ -1059,11 +1059,11 @@ discard block |
||
1059 | 1059 | */ |
1060 | 1060 | private function writeExternalSheet($sheetname) |
1061 | 1061 | { |
1062 | - $record = 0x0017; // Record identifier |
|
1063 | - $length = 0x02 + strlen($sheetname); // Number of bytes to follow |
|
1062 | + $record = 0x0017; // Record identifier |
|
1063 | + $length = 0x02 + strlen($sheetname); // Number of bytes to follow |
|
1064 | 1064 | |
1065 | - $cch = strlen($sheetname); // Length of sheet name |
|
1066 | - $rgch = 0x03; // Filename encoding |
|
1065 | + $cch = strlen($sheetname); // Length of sheet name |
|
1066 | + $rgch = 0x03; // Filename encoding |
|
1067 | 1067 | |
1068 | 1068 | $header = pack('vv', $record, $length); |
1069 | 1069 | $data = pack('CC', $cch, $rgch); |
@@ -1083,20 +1083,20 @@ discard block |
||
1083 | 1083 | */ |
1084 | 1084 | private function writeNameShort($index, $type, $rowmin, $rowmax, $colmin, $colmax) |
1085 | 1085 | { |
1086 | - $record = 0x0018; // Record identifier |
|
1087 | - $length = 0x0024; // Number of bytes to follow |
|
1088 | - |
|
1089 | - $grbit = 0x0020; // Option flags |
|
1090 | - $chKey = 0x00; // Keyboard shortcut |
|
1091 | - $cch = 0x01; // Length of text name |
|
1092 | - $cce = 0x0015; // Length of text definition |
|
1093 | - $ixals = $index + 1; // Sheet index |
|
1094 | - $itab = $ixals; // Equal to ixals |
|
1095 | - $cchCustMenu = 0x00; // Length of cust menu text |
|
1096 | - $cchDescription = 0x00; // Length of description text |
|
1097 | - $cchHelptopic = 0x00; // Length of help topic text |
|
1098 | - $cchStatustext = 0x00; // Length of status bar text |
|
1099 | - $rgch = $type; // Built-in name type |
|
1086 | + $record = 0x0018; // Record identifier |
|
1087 | + $length = 0x0024; // Number of bytes to follow |
|
1088 | + |
|
1089 | + $grbit = 0x0020; // Option flags |
|
1090 | + $chKey = 0x00; // Keyboard shortcut |
|
1091 | + $cch = 0x01; // Length of text name |
|
1092 | + $cce = 0x0015; // Length of text definition |
|
1093 | + $ixals = $index + 1; // Sheet index |
|
1094 | + $itab = $ixals; // Equal to ixals |
|
1095 | + $cchCustMenu = 0x00; // Length of cust menu text |
|
1096 | + $cchDescription = 0x00; // Length of description text |
|
1097 | + $cchHelptopic = 0x00; // Length of help topic text |
|
1098 | + $cchStatustext = 0x00; // Length of status bar text |
|
1099 | + $rgch = $type; // Built-in name type |
|
1100 | 1100 | |
1101 | 1101 | $unknown03 = 0x3b; |
1102 | 1102 | $unknown04 = 0xffff - $index; |
@@ -1147,19 +1147,19 @@ discard block |
||
1147 | 1147 | */ |
1148 | 1148 | private function writeNameLong($index, $type, $rowmin, $rowmax, $colmin, $colmax) |
1149 | 1149 | { |
1150 | - $record = 0x0018; // Record identifier |
|
1151 | - $length = 0x003d; // Number of bytes to follow |
|
1152 | - $grbit = 0x0020; // Option flags |
|
1153 | - $chKey = 0x00; // Keyboard shortcut |
|
1154 | - $cch = 0x01; // Length of text name |
|
1155 | - $cce = 0x002e; // Length of text definition |
|
1156 | - $ixals = $index + 1; // Sheet index |
|
1157 | - $itab = $ixals; // Equal to ixals |
|
1158 | - $cchCustMenu = 0x00; // Length of cust menu text |
|
1159 | - $cchDescription = 0x00; // Length of description text |
|
1160 | - $cchHelptopic = 0x00; // Length of help topic text |
|
1161 | - $cchStatustext = 0x00; // Length of status bar text |
|
1162 | - $rgch = $type; // Built-in name type |
|
1150 | + $record = 0x0018; // Record identifier |
|
1151 | + $length = 0x003d; // Number of bytes to follow |
|
1152 | + $grbit = 0x0020; // Option flags |
|
1153 | + $chKey = 0x00; // Keyboard shortcut |
|
1154 | + $cch = 0x01; // Length of text name |
|
1155 | + $cce = 0x002e; // Length of text definition |
|
1156 | + $ixals = $index + 1; // Sheet index |
|
1157 | + $itab = $ixals; // Equal to ixals |
|
1158 | + $cchCustMenu = 0x00; // Length of cust menu text |
|
1159 | + $cchDescription = 0x00; // Length of description text |
|
1160 | + $cchHelptopic = 0x00; // Length of help topic text |
|
1161 | + $cchStatustext = 0x00; // Length of status bar text |
|
1162 | + $rgch = $type; // Built-in name type |
|
1163 | 1163 | |
1164 | 1164 | $unknown01 = 0x29; |
1165 | 1165 | $unknown02 = 0x002b; |
@@ -1222,8 +1222,8 @@ discard block |
||
1222 | 1222 | */ |
1223 | 1223 | private function writeCountry() |
1224 | 1224 | { |
1225 | - $record = 0x008C; // Record identifier |
|
1226 | - $length = 4; // Number of bytes to follow |
|
1225 | + $record = 0x008C; // Record identifier |
|
1226 | + $length = 4; // Number of bytes to follow |
|
1227 | 1227 | |
1228 | 1228 | $header = pack('vv', $record, $length); |
1229 | 1229 | /* using the same country code always for simplicity */ |
@@ -1239,8 +1239,8 @@ discard block |
||
1239 | 1239 | */ |
1240 | 1240 | private function writeRecalcId() |
1241 | 1241 | { |
1242 | - $record = 0x01C1; // Record identifier |
|
1243 | - $length = 8; // Number of bytes to follow |
|
1242 | + $record = 0x01C1; // Record identifier |
|
1243 | + $length = 8; // Number of bytes to follow |
|
1244 | 1244 | |
1245 | 1245 | $header = pack('vv', $record, $length); |
1246 | 1246 | |
@@ -1257,10 +1257,10 @@ discard block |
||
1257 | 1257 | { |
1258 | 1258 | $aref = $this->palette; |
1259 | 1259 | |
1260 | - $record = 0x0092; // Record identifier |
|
1261 | - $length = 2 + 4 * count($aref); // Number of bytes to follow |
|
1262 | - $ccv = count($aref); // Number of RGB values to follow |
|
1263 | - $data = ''; // The RGB data |
|
1260 | + $record = 0x0092; // Record identifier |
|
1261 | + $length = 2 + 4 * count($aref); // Number of bytes to follow |
|
1262 | + $ccv = count($aref); // Number of RGB values to follow |
|
1263 | + $data = ''; // The RGB data |
|
1264 | 1264 | |
1265 | 1265 | // Pack the RGB data |
1266 | 1266 | foreach ($aref as $color) { |
@@ -68,7 +68,7 @@ discard block |
||
68 | 68 | * Get writer part |
69 | 69 | * |
70 | 70 | * @param string $pPartName Writer part name |
71 | - * @return \PhpSpreadsheet\Writer\Excel2007\WriterPart |
|
71 | + * @return OpenDocument\WriterPart|null |
|
72 | 72 | */ |
73 | 73 | public function getWriterPart($pPartName = '') |
74 | 74 | { |
@@ -179,7 +179,7 @@ discard block |
||
179 | 179 | * |
180 | 180 | * @param \PhpSpreadsheet\Spreadsheet $spreadsheet PhpSpreadsheet object |
181 | 181 | * @throws \PhpSpreadsheet\Writer\Exception |
182 | - * @return Excel2007 |
|
182 | + * @return OpenDocument |
|
183 | 183 | */ |
184 | 184 | public function setPhpSpreadsheet(\PhpSpreadsheet\SpreadSheet $spreadsheet = null) |
185 | 185 | { |
@@ -40,117 +40,117 @@ |
||
40 | 40 | { |
41 | 41 | switch ($codePage) { |
42 | 42 | case 367: |
43 | - return 'ASCII'; // ASCII |
|
43 | + return 'ASCII'; // ASCII |
|
44 | 44 | case 437: |
45 | - return 'CP437'; // OEM US |
|
45 | + return 'CP437'; // OEM US |
|
46 | 46 | case 720: |
47 | - throw new \PhpSpreadsheet\Exception('Code page 720 not supported.'); // OEM Arabic |
|
47 | + throw new \PhpSpreadsheet\Exception('Code page 720 not supported.'); // OEM Arabic |
|
48 | 48 | case 737: |
49 | - return 'CP737'; // OEM Greek |
|
49 | + return 'CP737'; // OEM Greek |
|
50 | 50 | case 775: |
51 | - return 'CP775'; // OEM Baltic |
|
51 | + return 'CP775'; // OEM Baltic |
|
52 | 52 | case 850: |
53 | - return 'CP850'; // OEM Latin I |
|
53 | + return 'CP850'; // OEM Latin I |
|
54 | 54 | case 852: |
55 | - return 'CP852'; // OEM Latin II (Central European) |
|
55 | + return 'CP852'; // OEM Latin II (Central European) |
|
56 | 56 | case 855: |
57 | - return 'CP855'; // OEM Cyrillic |
|
57 | + return 'CP855'; // OEM Cyrillic |
|
58 | 58 | case 857: |
59 | - return 'CP857'; // OEM Turkish |
|
59 | + return 'CP857'; // OEM Turkish |
|
60 | 60 | case 858: |
61 | - return 'CP858'; // OEM Multilingual Latin I with Euro |
|
61 | + return 'CP858'; // OEM Multilingual Latin I with Euro |
|
62 | 62 | case 860: |
63 | - return 'CP860'; // OEM Portugese |
|
63 | + return 'CP860'; // OEM Portugese |
|
64 | 64 | case 861: |
65 | - return 'CP861'; // OEM Icelandic |
|
65 | + return 'CP861'; // OEM Icelandic |
|
66 | 66 | case 862: |
67 | - return 'CP862'; // OEM Hebrew |
|
67 | + return 'CP862'; // OEM Hebrew |
|
68 | 68 | case 863: |
69 | - return 'CP863'; // OEM Canadian (French) |
|
69 | + return 'CP863'; // OEM Canadian (French) |
|
70 | 70 | case 864: |
71 | - return 'CP864'; // OEM Arabic |
|
71 | + return 'CP864'; // OEM Arabic |
|
72 | 72 | case 865: |
73 | - return 'CP865'; // OEM Nordic |
|
73 | + return 'CP865'; // OEM Nordic |
|
74 | 74 | case 866: |
75 | - return 'CP866'; // OEM Cyrillic (Russian) |
|
75 | + return 'CP866'; // OEM Cyrillic (Russian) |
|
76 | 76 | case 869: |
77 | - return 'CP869'; // OEM Greek (Modern) |
|
77 | + return 'CP869'; // OEM Greek (Modern) |
|
78 | 78 | case 874: |
79 | - return 'CP874'; // ANSI Thai |
|
79 | + return 'CP874'; // ANSI Thai |
|
80 | 80 | case 932: |
81 | - return 'CP932'; // ANSI Japanese Shift-JIS |
|
81 | + return 'CP932'; // ANSI Japanese Shift-JIS |
|
82 | 82 | case 936: |
83 | - return 'CP936'; // ANSI Chinese Simplified GBK |
|
83 | + return 'CP936'; // ANSI Chinese Simplified GBK |
|
84 | 84 | case 949: |
85 | - return 'CP949'; // ANSI Korean (Wansung) |
|
85 | + return 'CP949'; // ANSI Korean (Wansung) |
|
86 | 86 | case 950: |
87 | - return 'CP950'; // ANSI Chinese Traditional BIG5 |
|
87 | + return 'CP950'; // ANSI Chinese Traditional BIG5 |
|
88 | 88 | case 1200: |
89 | 89 | return 'UTF-16LE'; // UTF-16 (BIFF8) |
90 | 90 | case 1250: |
91 | - return 'CP1250'; // ANSI Latin II (Central European) |
|
91 | + return 'CP1250'; // ANSI Latin II (Central European) |
|
92 | 92 | case 1251: |
93 | - return 'CP1251'; // ANSI Cyrillic |
|
93 | + return 'CP1251'; // ANSI Cyrillic |
|
94 | 94 | case 0: |
95 | 95 | // CodePage is not always correctly set when the xls file was saved by Apple's Numbers program |
96 | 96 | case 1252: |
97 | - return 'CP1252'; // ANSI Latin I (BIFF4-BIFF7) |
|
97 | + return 'CP1252'; // ANSI Latin I (BIFF4-BIFF7) |
|
98 | 98 | case 1253: |
99 | - return 'CP1253'; // ANSI Greek |
|
99 | + return 'CP1253'; // ANSI Greek |
|
100 | 100 | case 1254: |
101 | - return 'CP1254'; // ANSI Turkish |
|
101 | + return 'CP1254'; // ANSI Turkish |
|
102 | 102 | case 1255: |
103 | - return 'CP1255'; // ANSI Hebrew |
|
103 | + return 'CP1255'; // ANSI Hebrew |
|
104 | 104 | case 1256: |
105 | - return 'CP1256'; // ANSI Arabic |
|
105 | + return 'CP1256'; // ANSI Arabic |
|
106 | 106 | case 1257: |
107 | - return 'CP1257'; // ANSI Baltic |
|
107 | + return 'CP1257'; // ANSI Baltic |
|
108 | 108 | case 1258: |
109 | - return 'CP1258'; // ANSI Vietnamese |
|
109 | + return 'CP1258'; // ANSI Vietnamese |
|
110 | 110 | case 1361: |
111 | - return 'CP1361'; // ANSI Korean (Johab) |
|
111 | + return 'CP1361'; // ANSI Korean (Johab) |
|
112 | 112 | case 10000: |
113 | - return 'MAC'; // Apple Roman |
|
113 | + return 'MAC'; // Apple Roman |
|
114 | 114 | case 10001: |
115 | - return 'CP932'; // Macintosh Japanese |
|
115 | + return 'CP932'; // Macintosh Japanese |
|
116 | 116 | case 10002: |
117 | - return 'CP950'; // Macintosh Chinese Traditional |
|
117 | + return 'CP950'; // Macintosh Chinese Traditional |
|
118 | 118 | case 10003: |
119 | - return 'CP1361'; // Macintosh Korean |
|
119 | + return 'CP1361'; // Macintosh Korean |
|
120 | 120 | case 10004: |
121 | 121 | return 'MACARABIC'; // Apple Arabic |
122 | 122 | case 10005: |
123 | 123 | return 'MACHEBREW'; // Apple Hebrew |
124 | 124 | case 10006: |
125 | - return 'MACGREEK'; // Macintosh Greek |
|
125 | + return 'MACGREEK'; // Macintosh Greek |
|
126 | 126 | case 10007: |
127 | - return 'MACCYRILLIC'; // Macintosh Cyrillic |
|
127 | + return 'MACCYRILLIC'; // Macintosh Cyrillic |
|
128 | 128 | case 10008: |
129 | - return 'CP936'; // Macintosh - Simplified Chinese (GB 2312) |
|
129 | + return 'CP936'; // Macintosh - Simplified Chinese (GB 2312) |
|
130 | 130 | case 10010: |
131 | - return 'MACROMANIA'; // Macintosh Romania |
|
131 | + return 'MACROMANIA'; // Macintosh Romania |
|
132 | 132 | case 10017: |
133 | - return 'MACUKRAINE'; // Macintosh Ukraine |
|
133 | + return 'MACUKRAINE'; // Macintosh Ukraine |
|
134 | 134 | case 10021: |
135 | - return 'MACTHAI'; // Macintosh Thai |
|
135 | + return 'MACTHAI'; // Macintosh Thai |
|
136 | 136 | case 10029: |
137 | - return 'MACCENTRALEUROPE'; // Macintosh Central Europe |
|
137 | + return 'MACCENTRALEUROPE'; // Macintosh Central Europe |
|
138 | 138 | case 10079: |
139 | - return 'MACICELAND'; // Macintosh Icelandic |
|
139 | + return 'MACICELAND'; // Macintosh Icelandic |
|
140 | 140 | case 10081: |
141 | - return 'MACTURKISH'; // Macintosh Turkish |
|
141 | + return 'MACTURKISH'; // Macintosh Turkish |
|
142 | 142 | case 10082: |
143 | - return 'MACCROATIAN'; // Macintosh Croatian |
|
143 | + return 'MACCROATIAN'; // Macintosh Croatian |
|
144 | 144 | case 21010: |
145 | - return 'UTF-16LE'; // UTF-16 (BIFF8) This isn't correct, but some Excel writer libraries erroneously use Codepage 21010 for UTF-16LE |
|
145 | + return 'UTF-16LE'; // UTF-16 (BIFF8) This isn't correct, but some Excel writer libraries erroneously use Codepage 21010 for UTF-16LE |
|
146 | 146 | case 32768: |
147 | - return 'MAC'; // Apple Roman |
|
147 | + return 'MAC'; // Apple Roman |
|
148 | 148 | case 32769: |
149 | - throw new \PhpSpreadsheet\Exception('Code page 32769 not supported.'); // ANSI Latin I (BIFF2-BIFF3) |
|
149 | + throw new \PhpSpreadsheet\Exception('Code page 32769 not supported.'); // ANSI Latin I (BIFF2-BIFF3) |
|
150 | 150 | case 65000: |
151 | - return 'UTF-7'; // Unicode (UTF-7) |
|
151 | + return 'UTF-7'; // Unicode (UTF-7) |
|
152 | 152 | case 65001: |
153 | - return 'UTF-8'; // Unicode (UTF-8) |
|
153 | + return 'UTF-8'; // Unicode (UTF-8) |
|
154 | 154 | } |
155 | 155 | throw new \PhpSpreadsheet\Exception('Unknown codepage: ' . $codePage); |
156 | 156 | } |
@@ -460,7 +460,7 @@ discard block |
||
460 | 460 | * DATEVALUE(dateValue) |
461 | 461 | * |
462 | 462 | * @category Date/Time Functions |
463 | - * @param string $dateValue Text that represents a date in a Microsoft Excel date format. |
|
463 | + * @param integer $dateValue Text that represents a date in a Microsoft Excel date format. |
|
464 | 464 | * For example, "1/30/2008" or "30-Jan-2008" are text strings within |
465 | 465 | * quotation marks that represent dates. Using the default date |
466 | 466 | * system in Excel for Windows, date_text must represent a date from |
@@ -644,9 +644,9 @@ discard block |
||
644 | 644 | /** |
645 | 645 | * DATEDIF |
646 | 646 | * |
647 | - * @param mixed $startDate Excel date serial value, PHP date/time stamp, PHP DateTime object |
|
647 | + * @param integer $startDate Excel date serial value, PHP date/time stamp, PHP DateTime object |
|
648 | 648 | * or a standard date string |
649 | - * @param mixed $endDate Excel date serial value, PHP date/time stamp, PHP DateTime object |
|
649 | + * @param integer $endDate Excel date serial value, PHP date/time stamp, PHP DateTime object |
|
650 | 650 | * or a standard date string |
651 | 651 | * @param string $unit |
652 | 652 | * @return int Interval between the dates |
@@ -757,9 +757,9 @@ discard block |
||
757 | 757 | * DAYS360(startDate,endDate[,method]) |
758 | 758 | * |
759 | 759 | * @category Date/Time Functions |
760 | - * @param mixed $startDate Excel date serial value (float), PHP date timestamp (integer), |
|
760 | + * @param integer $startDate Excel date serial value (float), PHP date timestamp (integer), |
|
761 | 761 | * PHP DateTime object, or a standard date string |
762 | - * @param mixed $endDate Excel date serial value (float), PHP date timestamp (integer), |
|
762 | + * @param integer $endDate Excel date serial value (float), PHP date timestamp (integer), |
|
763 | 763 | * PHP DateTime object, or a standard date string |
764 | 764 | * @param bool $method US or European Method |
765 | 765 | * FALSE or omitted: U.S. (NASD) method. If the starting date is |
@@ -816,9 +816,9 @@ discard block |
||
816 | 816 | * YEARFRAC(startDate,endDate[,method]) |
817 | 817 | * |
818 | 818 | * @category Date/Time Functions |
819 | - * @param mixed $startDate Excel date serial value (float), PHP date timestamp (integer), |
|
819 | + * @param integer $startDate Excel date serial value (float), PHP date timestamp (integer), |
|
820 | 820 | * PHP DateTime object, or a standard date string |
821 | - * @param mixed $endDate Excel date serial value (float), PHP date timestamp (integer), |
|
821 | + * @param integer $endDate Excel date serial value (float), PHP date timestamp (integer), |
|
822 | 822 | * PHP DateTime object, or a standard date string |
823 | 823 | * @param int $method Method used for the calculation |
824 | 824 | * 0 or omitted US (NASD) 30/360 |
@@ -918,10 +918,6 @@ discard block |
||
918 | 918 | * PHP DateTime object, or a standard date string |
919 | 919 | * @param mixed $endDate Excel date serial value (float), PHP date timestamp (integer), |
920 | 920 | * PHP DateTime object, or a standard date string |
921 | - * @param mixed $holidays,... Optional series of Excel date serial value (float), PHP date |
|
922 | - * timestamp (integer), PHP DateTime object, or a standard date |
|
923 | - * strings that will be excluded from the working calendar, such |
|
924 | - * as state and federal holidays and floating holidays. |
|
925 | 921 | * @return int Interval between the dates |
926 | 922 | */ |
927 | 923 | public static function NETWORKDAYS($startDate, $endDate) |
@@ -1003,10 +999,6 @@ discard block |
||
1003 | 999 | * @param int $endDays The number of nonweekend and nonholiday days before or after |
1004 | 1000 | * startDate. A positive value for days yields a future date; a |
1005 | 1001 | * negative value yields a past date. |
1006 | - * @param mixed $holidays,... Optional series of Excel date serial value (float), PHP date |
|
1007 | - * timestamp (integer), PHP DateTime object, or a standard date |
|
1008 | - * strings that will be excluded from the working calendar, such |
|
1009 | - * as state and federal holidays and floating holidays. |
|
1010 | 1002 | * @return mixed Excel date/time serial value, PHP date/time serial value or PHP date/time object, |
1011 | 1003 | * depending on the value of the ReturnDateType flag |
1012 | 1004 | */ |
@@ -1110,7 +1102,7 @@ discard block |
||
1110 | 1102 | * Excel Function: |
1111 | 1103 | * DAY(dateValue) |
1112 | 1104 | * |
1113 | - * @param mixed $dateValue Excel date serial value (float), PHP date timestamp (integer), |
|
1105 | + * @param integer $dateValue Excel date serial value (float), PHP date timestamp (integer), |
|
1114 | 1106 | * PHP DateTime object, or a standard date string |
1115 | 1107 | * @return int Day of the month |
1116 | 1108 | */ |
@@ -1143,7 +1135,7 @@ discard block |
||
1143 | 1135 | * Excel Function: |
1144 | 1136 | * WEEKDAY(dateValue[,style]) |
1145 | 1137 | * |
1146 | - * @param mixed $dateValue Excel date serial value (float), PHP date timestamp (integer), |
|
1138 | + * @param integer $dateValue Excel date serial value (float), PHP date timestamp (integer), |
|
1147 | 1139 | * PHP DateTime object, or a standard date string |
1148 | 1140 | * @param int $style A number that determines the type of return value |
1149 | 1141 | * 1 or omitted Numbers 1 (Sunday) through 7 (Saturday). |
@@ -1219,9 +1211,9 @@ discard block |
||
1219 | 1211 | * Excel Function: |
1220 | 1212 | * WEEKNUM(dateValue[,style]) |
1221 | 1213 | * |
1222 | - * @param mixed $dateValue Excel date serial value (float), PHP date timestamp (integer), |
|
1214 | + * @param integer $dateValue Excel date serial value (float), PHP date timestamp (integer), |
|
1223 | 1215 | * PHP DateTime object, or a standard date string |
1224 | - * @param bool $method Week begins on Sunday or Monday |
|
1216 | + * @param integer $method Week begins on Sunday or Monday |
|
1225 | 1217 | * 1 or omitted Week begins on Sunday. |
1226 | 1218 | * 2 Week begins on Monday. |
1227 | 1219 | * @return int Week Number |
@@ -1267,7 +1259,7 @@ discard block |
||
1267 | 1259 | * Excel Function: |
1268 | 1260 | * MONTH(dateValue) |
1269 | 1261 | * |
1270 | - * @param mixed $dateValue Excel date serial value (float), PHP date timestamp (integer), |
|
1262 | + * @param integer $dateValue Excel date serial value (float), PHP date timestamp (integer), |
|
1271 | 1263 | * PHP DateTime object, or a standard date string |
1272 | 1264 | * @return int Month of the year |
1273 | 1265 | */ |
@@ -1299,7 +1291,7 @@ discard block |
||
1299 | 1291 | * Excel Function: |
1300 | 1292 | * YEAR(dateValue) |
1301 | 1293 | * |
1302 | - * @param mixed $dateValue Excel date serial value (float), PHP date timestamp (integer), |
|
1294 | + * @param integer $dateValue Excel date serial value (float), PHP date timestamp (integer), |
|
1303 | 1295 | * PHP DateTime object, or a standard date string |
1304 | 1296 | * @return int Year |
1305 | 1297 | */ |
@@ -1330,7 +1322,7 @@ discard block |
||
1330 | 1322 | * Excel Function: |
1331 | 1323 | * HOUR(timeValue) |
1332 | 1324 | * |
1333 | - * @param mixed $timeValue Excel date serial value (float), PHP date timestamp (integer), |
|
1325 | + * @param integer $timeValue Excel date serial value (float), PHP date timestamp (integer), |
|
1334 | 1326 | * PHP DateTime object, or a standard time string |
1335 | 1327 | * @return int Hour |
1336 | 1328 | */ |
@@ -1370,7 +1362,7 @@ discard block |
||
1370 | 1362 | * Excel Function: |
1371 | 1363 | * MINUTE(timeValue) |
1372 | 1364 | * |
1373 | - * @param mixed $timeValue Excel date serial value (float), PHP date timestamp (integer), |
|
1365 | + * @param integer $timeValue Excel date serial value (float), PHP date timestamp (integer), |
|
1374 | 1366 | * PHP DateTime object, or a standard time string |
1375 | 1367 | * @return int Minute |
1376 | 1368 | */ |
@@ -1410,7 +1402,7 @@ discard block |
||
1410 | 1402 | * Excel Function: |
1411 | 1403 | * SECOND(timeValue) |
1412 | 1404 | * |
1413 | - * @param mixed $timeValue Excel date serial value (float), PHP date timestamp (integer), |
|
1405 | + * @param integer $timeValue Excel date serial value (float), PHP date timestamp (integer), |
|
1414 | 1406 | * PHP DateTime object, or a standard time string |
1415 | 1407 | * @return int Second |
1416 | 1408 | */ |
@@ -1452,7 +1444,7 @@ discard block |
||
1452 | 1444 | * Excel Function: |
1453 | 1445 | * EDATE(dateValue,adjustmentMonths) |
1454 | 1446 | * |
1455 | - * @param mixed $dateValue Excel date serial value (float), PHP date timestamp (integer), |
|
1447 | + * @param integer $dateValue Excel date serial value (float), PHP date timestamp (integer), |
|
1456 | 1448 | * PHP DateTime object, or a standard date string |
1457 | 1449 | * @param int $adjustmentMonths The number of months before or after start_date. |
1458 | 1450 | * A positive value for months yields a future date; |
@@ -1497,7 +1489,7 @@ discard block |
||
1497 | 1489 | * Excel Function: |
1498 | 1490 | * EOMONTH(dateValue,adjustmentMonths) |
1499 | 1491 | * |
1500 | - * @param mixed $dateValue Excel date serial value (float), PHP date timestamp (integer), |
|
1492 | + * @param integer $dateValue Excel date serial value (float), PHP date timestamp (integer), |
|
1501 | 1493 | * PHP DateTime object, or a standard date string |
1502 | 1494 | * @param int $adjustmentMonths The number of months before or after start_date. |
1503 | 1495 | * A positive value for months yields a future date; |
@@ -424,7 +424,7 @@ discard block |
||
424 | 424 | |
425 | 425 | return (float) \PhpSpreadsheet\Shared\Date::formattedPHPToExcel($calendar, 1, $date, $hour, $minute, $second); |
426 | 426 | case Functions::RETURNDATE_PHP_NUMERIC: |
427 | - return (integer) \PhpSpreadsheet\Shared\Date::excelToTimestamp(\PhpSpreadsheet\Shared\Date::formattedPHPToExcel(1970, 1, 1, $hour, $minute, $second)); // -2147468400; // -2147472000 + 3600 |
|
427 | + return (integer) \PhpSpreadsheet\Shared\Date::excelToTimestamp(\PhpSpreadsheet\Shared\Date::formattedPHPToExcel(1970, 1, 1, $hour, $minute, $second)); // -2147468400; // -2147472000 + 3600 |
|
428 | 428 | case Functions::RETURNDATE_PHP_OBJECT: |
429 | 429 | $dayAdjust = 0; |
430 | 430 | if ($hour < 0) { |
@@ -1036,7 +1036,7 @@ discard block |
||
1036 | 1036 | |
1037 | 1037 | $startDoW = self::DAYOFWEEK($startDate, 3); |
1038 | 1038 | if (self::DAYOFWEEK($startDate, 3) >= 5) { |
1039 | - $startDate += ($decrementing) ? -$startDoW + 4: 7 - $startDoW; |
|
1039 | + $startDate += ($decrementing) ? -$startDoW + 4 : 7 - $startDoW; |
|
1040 | 1040 | ($decrementing) ? $endDays++ : $endDays--; |
1041 | 1041 | } |
1042 | 1042 | |
@@ -1046,7 +1046,7 @@ discard block |
||
1046 | 1046 | // Adjust the calculated end date if it falls over a weekend |
1047 | 1047 | $endDoW = self::DAYOFWEEK($endDate, 3); |
1048 | 1048 | if ($endDoW >= 5) { |
1049 | - $endDate += ($decrementing) ? -$endDoW + 4: 7 - $endDoW; |
|
1049 | + $endDate += ($decrementing) ? -$endDoW + 4 : 7 - $endDoW; |
|
1050 | 1050 | } |
1051 | 1051 | |
1052 | 1052 | // Test any extra holiday parameters |