@@ -119,7 +119,7 @@ |
||
119 | 119 | * |
120 | 120 | * @throws Exception |
121 | 121 | * |
122 | - * @return string |
|
122 | + * @return FormulaToken |
|
123 | 123 | */ |
124 | 124 | public function getToken($pId = 0) |
125 | 125 | { |
@@ -57,8 +57,8 @@ discard block |
||
57 | 57 | /** |
58 | 58 | * Create a new Theme. |
59 | 59 | * |
60 | - * @param mixed $themeName |
|
61 | - * @param mixed $colourSchemeName |
|
60 | + * @param string $themeName |
|
61 | + * @param string $colourSchemeName |
|
62 | 62 | * @param mixed $colourMap |
63 | 63 | */ |
64 | 64 | public function __construct($themeName, $colourSchemeName, $colourMap) |
@@ -92,7 +92,7 @@ discard block |
||
92 | 92 | /** |
93 | 93 | * Get colour Map Value by Position. |
94 | 94 | * |
95 | - * @param mixed $index |
|
95 | + * @param integer $index |
|
96 | 96 | * |
97 | 97 | * @return string |
98 | 98 | */ |
@@ -41,7 +41,7 @@ |
||
41 | 41 | echo '<b>Custom Properties: </b><br />'; |
42 | 42 | /* Loop through the list of custom properties **/ |
43 | 43 | foreach ($customPropertyList as $customPropertyName) { |
44 | - echo '<b>',$customPropertyName,': </b>'; |
|
44 | + echo '<b>', $customPropertyName, ': </b>'; |
|
45 | 45 | /* Retrieve the property value **/ |
46 | 46 | $propertyValue = $spreadsheet->getProperties()->getCustomPropertyValue($customPropertyName); |
47 | 47 | /* Retrieve the property type **/ |
@@ -30,11 +30,11 @@ |
||
30 | 30 | |
31 | 31 | $reader = \PhpOffice\PhpSpreadsheet\IOFactory::createReader($inputFileType); |
32 | 32 | $inputFileName = array_shift($inputFileNames); |
33 | -echo 'Loading file ',pathinfo($inputFileName, PATHINFO_BASENAME),' into WorkSheet #1 using IOFactory with a defined reader type of ',$inputFileType,'<br />'; |
|
33 | +echo 'Loading file ', pathinfo($inputFileName, PATHINFO_BASENAME), ' into WorkSheet #1 using IOFactory with a defined reader type of ', $inputFileType, '<br />'; |
|
34 | 34 | $spreadsheet = $reader->load($inputFileName); |
35 | 35 | $spreadsheet->getActiveSheet()->setTitle(pathinfo($inputFileName, PATHINFO_BASENAME)); |
36 | 36 | foreach ($inputFileNames as $sheet => $inputFileName) { |
37 | - echo 'Loading file ',pathinfo($inputFileName, PATHINFO_BASENAME),' into WorkSheet #',($sheet + 2),' using IOFactory with a defined reader type of ',$inputFileType,'<br />'; |
|
37 | + echo 'Loading file ', pathinfo($inputFileName, PATHINFO_BASENAME), ' into WorkSheet #', ($sheet + 2), ' using IOFactory with a defined reader type of ', $inputFileType, '<br />'; |
|
38 | 38 | $reader->setSheetIndex($sheet + 1); |
39 | 39 | $reader->loadIntoExisting($inputFileName, $spreadsheet); |
40 | 40 | $spreadsheet->getActiveSheet()->setTitle(pathinfo($inputFileName, PATHINFO_BASENAME)); |
@@ -26,17 +26,17 @@ |
||
26 | 26 | $inputFileName = './sampleData/example1.tsv'; |
27 | 27 | |
28 | 28 | $reader = \PhpOffice\PhpSpreadsheet\IOFactory::createReader($inputFileType); |
29 | -echo 'Loading file ',pathinfo($inputFileName, PATHINFO_BASENAME),' into WorkSheet #1 using IOFactory with a defined reader type of ',$inputFileType,'<br />'; |
|
29 | +echo 'Loading file ', pathinfo($inputFileName, PATHINFO_BASENAME), ' into WorkSheet #1 using IOFactory with a defined reader type of ', $inputFileType, '<br />'; |
|
30 | 30 | $reader->setDelimiter("\t"); |
31 | 31 | $spreadsheet = $reader->load($inputFileName); |
32 | 32 | $spreadsheet->getActiveSheet()->setTitle(pathinfo($inputFileName, PATHINFO_BASENAME)); |
33 | 33 | |
34 | 34 | echo '<hr />'; |
35 | 35 | |
36 | -echo $spreadsheet->getSheetCount(),' worksheet',(($spreadsheet->getSheetCount() == 1) ? '' : 's'),' loaded<br /><br />'; |
|
36 | +echo $spreadsheet->getSheetCount(), ' worksheet', (($spreadsheet->getSheetCount() == 1) ? '' : 's'), ' loaded<br /><br />'; |
|
37 | 37 | $loadedSheetNames = $spreadsheet->getSheetNames(); |
38 | 38 | foreach ($loadedSheetNames as $sheetIndex => $loadedSheetName) { |
39 | - echo '<b>Worksheet #',$sheetIndex,' -> ',$loadedSheetName,' (Formatted)</b><br />'; |
|
39 | + echo '<b>Worksheet #', $sheetIndex, ' -> ', $loadedSheetName, ' (Formatted)</b><br />'; |
|
40 | 40 | $spreadsheet->setActiveSheetIndexByName($loadedSheetName); |
41 | 41 | $sheetData = $spreadsheet->getActiveSheet()->toArray(null, true, true, true); |
42 | 42 | var_dump($sheetData); |
@@ -294,6 +294,11 @@ discard block |
||
294 | 294 | return isset($c->v) ? (string) $c->v : null; |
295 | 295 | } |
296 | 296 | |
297 | + /** |
|
298 | + * @param string $r |
|
299 | + * @param string $cellDataType |
|
300 | + * @param string $castBaseType |
|
301 | + */ |
|
297 | 302 | private function castToFormula($c, $r, &$cellDataType, &$value, &$calculatedValue, &$sharedFormulas, $castBaseType) |
298 | 303 | { |
299 | 304 | $cellDataType = 'f'; |
@@ -2159,6 +2164,9 @@ discard block |
||
2159 | 2164 | return preg_replace('~[^/]+/\.\./~', '', dirname($base) . "/$add"); |
2160 | 2165 | } |
2161 | 2166 | |
2167 | + /** |
|
2168 | + * @param string $style |
|
2169 | + */ |
|
2162 | 2170 | private static function toCSSArray($style) |
2163 | 2171 | { |
2164 | 2172 | $style = str_replace(["\r", "\n"], '', $style); |
@@ -168,16 +168,25 @@ discard block |
||
168 | 168 | return fread($this->fileHandle, $blockSize); |
169 | 169 | } |
170 | 170 | |
171 | + /** |
|
172 | + * @param string $data |
|
173 | + */ |
|
171 | 174 | private static function startsWithTag($data) |
172 | 175 | { |
173 | 176 | return '<' === substr(trim($data), 0, 1); |
174 | 177 | } |
175 | 178 | |
179 | + /** |
|
180 | + * @param string $data |
|
181 | + */ |
|
176 | 182 | private static function endsWithTag($data) |
177 | 183 | { |
178 | 184 | return '>' === substr(trim($data), -1, 1); |
179 | 185 | } |
180 | 186 | |
187 | + /** |
|
188 | + * @param string $data |
|
189 | + */ |
|
181 | 190 | private static function containsTags($data) |
182 | 191 | { |
183 | 192 | return strlen($data) !== strlen(strip_tags($data)); |
@@ -249,6 +258,10 @@ discard block |
||
249 | 258 | return array_pop($this->nestedColumn); |
250 | 259 | } |
251 | 260 | |
261 | + /** |
|
262 | + * @param \PhpOffice\PhpSpreadsheet\Worksheet $sheet |
|
263 | + * @param integer $row |
|
264 | + */ |
|
252 | 265 | protected function flushCell($sheet, $column, $row, &$cellContent) |
253 | 266 | { |
254 | 267 | if (is_string($cellContent)) { |
@@ -2075,7 +2075,6 @@ discard block |
||
2075 | 2075 | /** |
2076 | 2076 | * Unset an instance of this class. |
2077 | 2077 | * |
2078 | - * @param Spreadsheet $spreadsheet Injected spreadsheet identifying the instance to unset |
|
2079 | 2078 | */ |
2080 | 2079 | public function __destruct() |
2081 | 2080 | { |
@@ -2329,6 +2328,10 @@ discard block |
||
2329 | 2328 | return false; |
2330 | 2329 | } |
2331 | 2330 | |
2331 | + /** |
|
2332 | + * @param string $fromSeparator |
|
2333 | + * @param string $toSeparator |
|
2334 | + */ |
|
2332 | 2335 | public static function translateSeparator($fromSeparator, $toSeparator, $formula, &$inBraces) |
2333 | 2336 | { |
2334 | 2337 | $strlen = mb_strlen($formula); |
@@ -2672,6 +2675,9 @@ discard block |
||
2672 | 2675 | return $result; |
2673 | 2676 | } |
2674 | 2677 | |
2678 | + /** |
|
2679 | + * @param string $cellReference |
|
2680 | + */ |
|
2675 | 2681 | public function getValueFromCache($cellReference, &$cellValue) |
2676 | 2682 | { |
2677 | 2683 | // Is calculation cacheing enabled? |
@@ -2815,7 +2821,7 @@ discard block |
||
2815 | 2821 | * |
2816 | 2822 | * @param mixed &$matrix matrix operand |
2817 | 2823 | * |
2818 | - * @return int[] An array comprising the number of rows, and number of columns |
|
2824 | + * @return integer[] An array comprising the number of rows, and number of columns |
|
2819 | 2825 | */ |
2820 | 2826 | private static function getMatrixDimensions(&$matrix) |
2821 | 2827 | { |
@@ -3000,6 +3006,9 @@ discard block |
||
3000 | 3006 | } |
3001 | 3007 | } |
3002 | 3008 | |
3009 | + /** |
|
3010 | + * @param string $formula |
|
3011 | + */ |
|
3003 | 3012 | private function convertMatrixReferences($formula) |
3004 | 3013 | { |
3005 | 3014 | static $matrixReplaceFrom = ['{', ';', '}']; |
@@ -3088,6 +3097,10 @@ discard block |
||
3088 | 3097 | ]; |
3089 | 3098 | |
3090 | 3099 | // Convert infix to postfix notation |
3100 | + |
|
3101 | + /** |
|
3102 | + * @param string $formula |
|
3103 | + */ |
|
3091 | 3104 | private function _parseFormula($formula, Cell $pCell = null) |
3092 | 3105 | { |
3093 | 3106 | if (($formula = $this->convertMatrixReferences(trim($formula))) === false) { |
@@ -3824,6 +3837,9 @@ discard block |
||
3824 | 3837 | return true; |
3825 | 3838 | } |
3826 | 3839 | |
3840 | + /** |
|
3841 | + * @param string|null $cellID |
|
3842 | + */ |
|
3827 | 3843 | private function executeBinaryComparisonOperation($cellID, $operand1, $operand2, $operation, &$stack, $recursingArrays = false) |
3828 | 3844 | { |
3829 | 3845 | // If we're dealing with matrix operations, we want a matrix result |
@@ -3964,7 +3980,7 @@ discard block |
||
3964 | 3980 | |
3965 | 3981 | /** |
3966 | 3982 | * @param string $matrixFunction |
3967 | - * @param mixed $cellID |
|
3983 | + * @param string|null $cellID |
|
3968 | 3984 | * @param mixed $operand1 |
3969 | 3985 | * @param mixed $operand2 |
3970 | 3986 | * @param mixed $operation |
@@ -471,7 +471,7 @@ discard block |
||
471 | 471 | * |
472 | 472 | * @category Date/Time Functions |
473 | 473 | * |
474 | - * @param string $dateValue Text that represents a date in a Microsoft Excel date format. |
|
474 | + * @param integer $dateValue Text that represents a date in a Microsoft Excel date format. |
|
475 | 475 | * For example, "1/30/2008" or "30-Jan-2008" are text strings within |
476 | 476 | * quotation marks that represent dates. Using the default date |
477 | 477 | * system in Excel for Windows, date_text must represent a date from |
@@ -657,9 +657,9 @@ discard block |
||
657 | 657 | /** |
658 | 658 | * DATEDIF. |
659 | 659 | * |
660 | - * @param mixed $startDate Excel date serial value, PHP date/time stamp, PHP DateTime object |
|
660 | + * @param integer $startDate Excel date serial value, PHP date/time stamp, PHP DateTime object |
|
661 | 661 | * or a standard date string |
662 | - * @param mixed $endDate Excel date serial value, PHP date/time stamp, PHP DateTime object |
|
662 | + * @param integer $endDate Excel date serial value, PHP date/time stamp, PHP DateTime object |
|
663 | 663 | * or a standard date string |
664 | 664 | * @param string $unit |
665 | 665 | * |
@@ -783,9 +783,9 @@ discard block |
||
783 | 783 | * |
784 | 784 | * @category Date/Time Functions |
785 | 785 | * |
786 | - * @param mixed $startDate Excel date serial value (float), PHP date timestamp (integer), |
|
786 | + * @param integer $startDate Excel date serial value (float), PHP date timestamp (integer), |
|
787 | 787 | * PHP DateTime object, or a standard date string |
788 | - * @param mixed $endDate Excel date serial value (float), PHP date timestamp (integer), |
|
788 | + * @param integer $endDate Excel date serial value (float), PHP date timestamp (integer), |
|
789 | 789 | * PHP DateTime object, or a standard date string |
790 | 790 | * @param bool $method US or European Method |
791 | 791 | * FALSE or omitted: U.S. (NASD) method. If the starting date is |
@@ -844,9 +844,9 @@ discard block |
||
844 | 844 | * |
845 | 845 | * @category Date/Time Functions |
846 | 846 | * |
847 | - * @param mixed $startDate Excel date serial value (float), PHP date timestamp (integer), |
|
847 | + * @param integer $startDate Excel date serial value (float), PHP date timestamp (integer), |
|
848 | 848 | * PHP DateTime object, or a standard date string |
849 | - * @param mixed $endDate Excel date serial value (float), PHP date timestamp (integer), |
|
849 | + * @param integer $endDate Excel date serial value (float), PHP date timestamp (integer), |
|
850 | 850 | * PHP DateTime object, or a standard date string |
851 | 851 | * @param int $method Method used for the calculation |
852 | 852 | * 0 or omitted US (NASD) 30/360 |
@@ -1135,7 +1135,7 @@ discard block |
||
1135 | 1135 | * Excel Function: |
1136 | 1136 | * DAY(dateValue) |
1137 | 1137 | * |
1138 | - * @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), |
|
1139 | 1139 | * PHP DateTime object, or a standard date string |
1140 | 1140 | * |
1141 | 1141 | * @return int Day of the month |
@@ -1246,7 +1246,7 @@ discard block |
||
1246 | 1246 | * Excel Function: |
1247 | 1247 | * WEEKNUM(dateValue[,style]) |
1248 | 1248 | * |
1249 | - * @param mixed $dateValue Excel date serial value (float), PHP date timestamp (integer), |
|
1249 | + * @param integer $dateValue Excel date serial value (float), PHP date timestamp (integer), |
|
1250 | 1250 | * PHP DateTime object, or a standard date string |
1251 | 1251 | * @param int $method Week begins on Sunday or Monday |
1252 | 1252 | * 1 or omitted Week begins on Sunday. |
@@ -1299,7 +1299,7 @@ discard block |
||
1299 | 1299 | * Excel Function: |
1300 | 1300 | * MONTH(dateValue) |
1301 | 1301 | * |
1302 | - * @param mixed $dateValue Excel date serial value (float), PHP date timestamp (integer), |
|
1302 | + * @param integer $dateValue Excel date serial value (float), PHP date timestamp (integer), |
|
1303 | 1303 | * PHP DateTime object, or a standard date string |
1304 | 1304 | * |
1305 | 1305 | * @return int Month of the year |
@@ -1332,7 +1332,7 @@ discard block |
||
1332 | 1332 | * Excel Function: |
1333 | 1333 | * YEAR(dateValue) |
1334 | 1334 | * |
1335 | - * @param mixed $dateValue Excel date serial value (float), PHP date timestamp (integer), |
|
1335 | + * @param integer $dateValue Excel date serial value (float), PHP date timestamp (integer), |
|
1336 | 1336 | * PHP DateTime object, or a standard date string |
1337 | 1337 | * |
1338 | 1338 | * @return int Year |
@@ -1364,7 +1364,7 @@ discard block |
||
1364 | 1364 | * Excel Function: |
1365 | 1365 | * HOUR(timeValue) |
1366 | 1366 | * |
1367 | - * @param mixed $timeValue Excel date serial value (float), PHP date timestamp (integer), |
|
1367 | + * @param integer $timeValue Excel date serial value (float), PHP date timestamp (integer), |
|
1368 | 1368 | * PHP DateTime object, or a standard time string |
1369 | 1369 | * |
1370 | 1370 | * @return int Hour |
@@ -1405,7 +1405,7 @@ discard block |
||
1405 | 1405 | * Excel Function: |
1406 | 1406 | * MINUTE(timeValue) |
1407 | 1407 | * |
1408 | - * @param mixed $timeValue Excel date serial value (float), PHP date timestamp (integer), |
|
1408 | + * @param integer $timeValue Excel date serial value (float), PHP date timestamp (integer), |
|
1409 | 1409 | * PHP DateTime object, or a standard time string |
1410 | 1410 | * |
1411 | 1411 | * @return int Minute |
@@ -1446,7 +1446,7 @@ discard block |
||
1446 | 1446 | * Excel Function: |
1447 | 1447 | * SECOND(timeValue) |
1448 | 1448 | * |
1449 | - * @param mixed $timeValue Excel date serial value (float), PHP date timestamp (integer), |
|
1449 | + * @param integer $timeValue Excel date serial value (float), PHP date timestamp (integer), |
|
1450 | 1450 | * PHP DateTime object, or a standard time string |
1451 | 1451 | * |
1452 | 1452 | * @return int Second |
@@ -1489,7 +1489,7 @@ discard block |
||
1489 | 1489 | * Excel Function: |
1490 | 1490 | * EDATE(dateValue,adjustmentMonths) |
1491 | 1491 | * |
1492 | - * @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), |
|
1493 | 1493 | * PHP DateTime object, or a standard date string |
1494 | 1494 | * @param int $adjustmentMonths The number of months before or after start_date. |
1495 | 1495 | * A positive value for months yields a future date; |
@@ -1535,7 +1535,7 @@ discard block |
||
1535 | 1535 | * Excel Function: |
1536 | 1536 | * EOMONTH(dateValue,adjustmentMonths) |
1537 | 1537 | * |
1538 | - * @param mixed $dateValue Excel date serial value (float), PHP date timestamp (integer), |
|
1538 | + * @param integer $dateValue Excel date serial value (float), PHP date timestamp (integer), |
|
1539 | 1539 | * PHP DateTime object, or a standard date string |
1540 | 1540 | * @param int $adjustmentMonths The number of months before or after start_date. |
1541 | 1541 | * A positive value for months yields a future date; |