@@ -113,7 +113,7 @@ discard block |
||
113 | 113 | /** |
114 | 114 | * Set the Default timezone to use for dates |
115 | 115 | * |
116 | - * @param string|\DateTimeZone $timezone The timezone to set for all Excel datetimestamp to PHP DateTime Object conversions |
|
116 | + * @param string|\DateTimeZone $timeZone The timezone to set for all Excel datetimestamp to PHP DateTime Object conversions |
|
117 | 117 | * @throws \Exception |
118 | 118 | * @return bool Success or failure |
119 | 119 | */ |
@@ -145,7 +145,7 @@ discard block |
||
145 | 145 | /** |
146 | 146 | * Validate a timezone |
147 | 147 | * |
148 | - * @param string|\DateTimeZone $timezone The timezone to validate, either as a timezone string or object |
|
148 | + * @param string|\DateTimeZone $timeZone The timezone to validate, either as a timezone string or object |
|
149 | 149 | * @throws \Exception |
150 | 150 | * @return \DateTimeZone The timezone as a timezone object |
151 | 151 | */ |
@@ -162,8 +162,7 @@ discard block |
||
162 | 162 | /** |
163 | 163 | * Convert a MS serialized datetime value from Excel to a PHP Date/Time object |
164 | 164 | * |
165 | - * @param int|float $dateValue MS Excel serialized date/time value |
|
166 | - * @param \DateTimeZone|string|null $timezone The timezone to assume for the Excel timestamp, |
|
165 | + * @param \DateTimeZone|string|null $timeZone The timezone to assume for the Excel timestamp, |
|
167 | 166 | * if you don't want to treat it as a UTC value |
168 | 167 | * Use the default (UST) unless you absolutely need a conversion |
169 | 168 | * @throws \Exception |
@@ -201,8 +200,7 @@ discard block |
||
201 | 200 | /** |
202 | 201 | * Convert a MS serialized datetime value from Excel to a unix timestamp |
203 | 202 | * |
204 | - * @param int|float $dateValue MS Excel serialized date/time value |
|
205 | - * @param \DateTimeZone|string|null $timezone The timezone to assume for the Excel timestamp, |
|
203 | + * @param \DateTimeZone|string|null $timeZone The timezone to assume for the Excel timestamp, |
|
206 | 204 | * if you don't want to treat it as a UTC value |
207 | 205 | * Use the default (UST) unless you absolutely need a conversion |
208 | 206 | * @throws \Exception |
@@ -217,7 +215,7 @@ discard block |
||
217 | 215 | /** |
218 | 216 | * Convert a date from PHP to an MS Excel serialized date/time value |
219 | 217 | * |
220 | - * @param mixed $dateValue PHP serialized date/time or date object |
|
218 | + * @param integer $dateValue PHP serialized date/time or date object |
|
221 | 219 | * @return float|bool Excel date/time value |
222 | 220 | * or boolean FALSE on failure |
223 | 221 | */ |
@@ -255,7 +253,7 @@ discard block |
||
255 | 253 | /** |
256 | 254 | * Convert a Unix timestamp to an MS Excel serialized date/time value |
257 | 255 | * |
258 | - * @param \DateTimeInterface $dateValue PHP DateTime object |
|
256 | + * @param integer $dateValue PHP DateTime object |
|
259 | 257 | * @return float MS Excel serialized date/time value |
260 | 258 | */ |
261 | 259 | public static function timestampToExcel($dateValue = 0) |
@@ -276,7 +274,7 @@ discard block |
||
276 | 274 | * @param int $hours |
277 | 275 | * @param int $minutes |
278 | 276 | * @param int $seconds |
279 | - * @return int Excel date/time value |
|
277 | + * @return double Excel date/time value |
|
280 | 278 | */ |
281 | 279 | public static function formattedPHPToExcel($year, $month, $day, $hours = 0, $minutes = 0, $seconds = 0) |
282 | 280 | { |
@@ -29,8 +29,8 @@ |
||
29 | 29 | class Date |
30 | 30 | { |
31 | 31 | /** constants */ |
32 | - const CALENDAR_WINDOWS_1900 = 1900; // Base date of 1st Jan 1900 = 1.0 |
|
33 | - const CALENDAR_MAC_1904 = 1904; // Base date of 2nd Jan 1904 = 1.0 |
|
32 | + const CALENDAR_WINDOWS_1900 = 1900; // Base date of 1st Jan 1900 = 1.0 |
|
33 | + const CALENDAR_MAC_1904 = 1904; // Base date of 2nd Jan 1904 = 1.0 |
|
34 | 34 | |
35 | 35 | /* |
36 | 36 | * Names of the months of the year, indexed by shortname |
@@ -93,7 +93,7 @@ discard block |
||
93 | 93 | * @acces public |
94 | 94 | * @param string $file |
95 | 95 | * @throws \PhpSpreadsheet\Reader\Exception |
96 | - * @return mixed true on success, PEAR_Error on failure |
|
96 | + * @return boolean true on success, PEAR_Error on failure |
|
97 | 97 | */ |
98 | 98 | public function read($file) |
99 | 99 | { |
@@ -223,6 +223,7 @@ discard block |
||
223 | 223 | /** |
224 | 224 | * Reads a signed char. |
225 | 225 | * @param resource file handle |
226 | + * @param resource $fh |
|
226 | 227 | * @return int |
227 | 228 | */ |
228 | 229 | private static function _readInt1($fh) |
@@ -235,6 +236,7 @@ discard block |
||
235 | 236 | /** |
236 | 237 | * Reads an unsigned short (2 octets). |
237 | 238 | * @param resource file handle |
239 | + * @param resource $fh |
|
238 | 240 | * @return int |
239 | 241 | */ |
240 | 242 | private static function _readInt2($fh) |
@@ -247,6 +249,7 @@ discard block |
||
247 | 249 | /** |
248 | 250 | * Reads an unsigned long (4 octets). |
249 | 251 | * @param resource file handle |
252 | + * @param resource $fh |
|
250 | 253 | * @return int |
251 | 254 | */ |
252 | 255 | private static function _readInt4($fh) |
@@ -261,7 +264,8 @@ discard block |
||
261 | 264 | * creates an OLE_PPS object for each one. |
262 | 265 | * |
263 | 266 | * @param int the block id of the first block |
264 | - * @return mixed true on success, PEAR_Error on failure |
|
267 | + * @param integer $blockId |
|
268 | + * @return boolean true on success, PEAR_Error on failure |
|
265 | 269 | */ |
266 | 270 | public function _readPpsWks($blockId) |
267 | 271 | { |
@@ -266,7 +266,7 @@ |
||
266 | 266 | public function _readPpsWks($blockId) |
267 | 267 | { |
268 | 268 | $fh = $this->getStream($blockId); |
269 | - for ($pos = 0;; $pos += 128) { |
|
269 | + for ($pos = 0; ; $pos += 128) { |
|
270 | 270 | fseek($fh, $pos, SEEK_SET); |
271 | 271 | $nameUtf16 = fread($fh, 64); |
272 | 272 | $nameLength = self::_readInt2($fh); |
@@ -39,6 +39,7 @@ discard block |
||
39 | 39 | /** |
40 | 40 | * @param int $time_1st A timestamp |
41 | 41 | * @param int $time_2nd A timestamp |
42 | + * @param File[] $raChild |
|
42 | 43 | */ |
43 | 44 | public function __construct($time_1st, $time_2nd, $raChild) |
44 | 45 | { |
@@ -54,9 +55,9 @@ discard block |
||
54 | 55 | * If a resource pointer to a stream created by fopen() is passed |
55 | 56 | * it will be used, but you have to close such stream by yourself. |
56 | 57 | * |
57 | - * @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. |
|
58 | 59 | * @throws \PhpSpreadsheet\Writer\Exception |
59 | - * @return mixed true on success |
|
60 | + * @return boolean true on success |
|
60 | 61 | */ |
61 | 62 | public function save($filename) |
62 | 63 | { |
@@ -116,7 +117,7 @@ discard block |
||
116 | 117 | * Calculate some numbers |
117 | 118 | * |
118 | 119 | * @param array $raList Reference to an array of PPS's |
119 | - * @return array The array of numbers |
|
120 | + * @return double[] The array of numbers |
|
120 | 121 | */ |
121 | 122 | public function _calcSize(&$raList) |
122 | 123 | { |
@@ -154,7 +155,7 @@ discard block |
||
154 | 155 | * |
155 | 156 | * @param int $i2 The argument |
156 | 157 | * @see save() |
157 | - * @return int |
|
158 | + * @return double |
|
158 | 159 | */ |
159 | 160 | private static function adjust2($i2) |
160 | 161 | { |
@@ -63,11 +63,11 @@ discard block |
||
63 | 63 | // Initial Setting for saving |
64 | 64 | $this->_BIG_BLOCK_SIZE = pow( |
65 | 65 | 2, |
66 | - (isset($this->_BIG_BLOCK_SIZE))? self::adjust2($this->_BIG_BLOCK_SIZE) : 9 |
|
66 | + (isset($this->_BIG_BLOCK_SIZE)) ? self::adjust2($this->_BIG_BLOCK_SIZE) : 9 |
|
67 | 67 | ); |
68 | 68 | $this->_SMALL_BLOCK_SIZE = pow( |
69 | 69 | 2, |
70 | - (isset($this->_SMALL_BLOCK_SIZE))? self::adjust2($this->_SMALL_BLOCK_SIZE) : 6 |
|
70 | + (isset($this->_SMALL_BLOCK_SIZE)) ? self::adjust2($this->_SMALL_BLOCK_SIZE) : 6 |
|
71 | 71 | ); |
72 | 72 | |
73 | 73 | if (is_resource($filename)) { |
@@ -130,21 +130,21 @@ discard block |
||
130 | 130 | $raList[$i]->Size = $raList[$i]->getDataLen(); |
131 | 131 | if ($raList[$i]->Size < \PhpSpreadsheet\Shared\OLE::OLE_DATA_SIZE_SMALL) { |
132 | 132 | $iSBcnt += floor($raList[$i]->Size / $this->_SMALL_BLOCK_SIZE) |
133 | - + (($raList[$i]->Size % $this->_SMALL_BLOCK_SIZE)? 1: 0); |
|
133 | + + (($raList[$i]->Size % $this->_SMALL_BLOCK_SIZE) ? 1 : 0); |
|
134 | 134 | } else { |
135 | 135 | $iBBcnt += (floor($raList[$i]->Size / $this->_BIG_BLOCK_SIZE) + |
136 | - (($raList[$i]->Size % $this->_BIG_BLOCK_SIZE)? 1: 0)); |
|
136 | + (($raList[$i]->Size % $this->_BIG_BLOCK_SIZE) ? 1 : 0)); |
|
137 | 137 | } |
138 | 138 | } |
139 | 139 | } |
140 | 140 | $iSmallLen = $iSBcnt * $this->_SMALL_BLOCK_SIZE; |
141 | 141 | $iSlCnt = floor($this->_BIG_BLOCK_SIZE / \PhpSpreadsheet\Shared\OLE::OLE_LONG_INT_SIZE); |
142 | - $iSBDcnt = floor($iSBcnt / $iSlCnt) + (($iSBcnt % $iSlCnt)? 1:0); |
|
142 | + $iSBDcnt = floor($iSBcnt / $iSlCnt) + (($iSBcnt % $iSlCnt) ? 1 : 0); |
|
143 | 143 | $iBBcnt += (floor($iSmallLen / $this->_BIG_BLOCK_SIZE) + |
144 | - (($iSmallLen % $this->_BIG_BLOCK_SIZE)? 1: 0)); |
|
144 | + (($iSmallLen % $this->_BIG_BLOCK_SIZE) ? 1 : 0)); |
|
145 | 145 | $iCnt = count($raList); |
146 | 146 | $iBdCnt = $this->_BIG_BLOCK_SIZE / \PhpSpreadsheet\Shared\OLE::OLE_PPS_SIZE; |
147 | - $iPPScnt = (floor($iCnt / $iBdCnt) + (($iCnt % $iBdCnt)? 1: 0)); |
|
147 | + $iPPScnt = (floor($iCnt / $iBdCnt) + (($iCnt % $iBdCnt) ? 1 : 0)); |
|
148 | 148 | |
149 | 149 | return [$iSBDcnt, $iBBcnt, $iPPScnt]; |
150 | 150 | } |
@@ -160,7 +160,7 @@ discard block |
||
160 | 160 | { |
161 | 161 | $iWk = log($i2) / log(2); |
162 | 162 | |
163 | - return ($iWk > floor($iWk))? floor($iWk) + 1:$iWk; |
|
163 | + return ($iWk > floor($iWk)) ? floor($iWk) + 1 : $iWk; |
|
164 | 164 | } |
165 | 165 | |
166 | 166 | /** |
@@ -181,16 +181,16 @@ discard block |
||
181 | 181 | $iBdExL = 0; |
182 | 182 | $iAll = $iBBcnt + $iPPScnt + $iSBDcnt; |
183 | 183 | $iAllW = $iAll; |
184 | - $iBdCntW = floor($iAllW / $iBlCnt) + (($iAllW % $iBlCnt)? 1: 0); |
|
185 | - $iBdCnt = floor(($iAll + $iBdCntW) / $iBlCnt) + ((($iAllW + $iBdCntW) % $iBlCnt)? 1: 0); |
|
184 | + $iBdCntW = floor($iAllW / $iBlCnt) + (($iAllW % $iBlCnt) ? 1 : 0); |
|
185 | + $iBdCnt = floor(($iAll + $iBdCntW) / $iBlCnt) + ((($iAllW + $iBdCntW) % $iBlCnt) ? 1 : 0); |
|
186 | 186 | |
187 | 187 | // Calculate BD count |
188 | 188 | if ($iBdCnt > $i1stBdL) { |
189 | 189 | while (1) { |
190 | 190 | ++$iBdExL; |
191 | 191 | ++$iAllW; |
192 | - $iBdCntW = floor($iAllW / $iBlCnt) + (($iAllW % $iBlCnt)? 1: 0); |
|
193 | - $iBdCnt = floor(($iAllW + $iBdCntW) / $iBlCnt) + ((($iAllW + $iBdCntW) % $iBlCnt)? 1: 0); |
|
192 | + $iBdCntW = floor($iAllW / $iBlCnt) + (($iAllW % $iBlCnt) ? 1 : 0); |
|
193 | + $iBdCnt = floor(($iAllW + $iBdCntW) / $iBlCnt) + ((($iAllW + $iBdCntW) % $iBlCnt) ? 1 : 0); |
|
194 | 194 | if ($iBdCnt <= ($iBdExL * $iBlCnt + $i1stBdL)) { |
195 | 195 | break; |
196 | 196 | } |
@@ -278,7 +278,7 @@ discard block |
||
278 | 278 | $raList[$i]->startBlock = $iStBlk; |
279 | 279 | $iStBlk += |
280 | 280 | (floor($raList[$i]->Size / $this->_BIG_BLOCK_SIZE) + |
281 | - (($raList[$i]->Size % $this->_BIG_BLOCK_SIZE)? 1: 0)); |
|
281 | + (($raList[$i]->Size % $this->_BIG_BLOCK_SIZE) ? 1 : 0)); |
|
282 | 282 | } |
283 | 283 | // Close file for each PPS, and unlink it |
284 | 284 | //if (isset($raList[$i]->_PPS_FILE)) { |
@@ -310,7 +310,7 @@ discard block |
||
310 | 310 | } |
311 | 311 | if ($raList[$i]->Size < \PhpSpreadsheet\Shared\OLE::OLE_DATA_SIZE_SMALL) { |
312 | 312 | $iSmbCnt = floor($raList[$i]->Size / $this->_SMALL_BLOCK_SIZE) |
313 | - + (($raList[$i]->Size % $this->_SMALL_BLOCK_SIZE)? 1: 0); |
|
313 | + + (($raList[$i]->Size % $this->_SMALL_BLOCK_SIZE) ? 1 : 0); |
|
314 | 314 | // Add to SBD |
315 | 315 | $jB = $iSmbCnt - 1; |
316 | 316 | for ($j = 0; $j < $jB; ++$j) { |
@@ -384,15 +384,15 @@ discard block |
||
384 | 384 | $iBdExL = 0; |
385 | 385 | $iAll = $iBsize + $iPpsCnt + $iSbdSize; |
386 | 386 | $iAllW = $iAll; |
387 | - $iBdCntW = floor($iAllW / $iBbCnt) + (($iAllW % $iBbCnt)? 1: 0); |
|
388 | - $iBdCnt = floor(($iAll + $iBdCntW) / $iBbCnt) + ((($iAllW + $iBdCntW) % $iBbCnt)? 1: 0); |
|
387 | + $iBdCntW = floor($iAllW / $iBbCnt) + (($iAllW % $iBbCnt) ? 1 : 0); |
|
388 | + $iBdCnt = floor(($iAll + $iBdCntW) / $iBbCnt) + ((($iAllW + $iBdCntW) % $iBbCnt) ? 1 : 0); |
|
389 | 389 | // Calculate BD count |
390 | 390 | if ($iBdCnt > $i1stBdL) { |
391 | 391 | while (1) { |
392 | 392 | ++$iBdExL; |
393 | 393 | ++$iAllW; |
394 | - $iBdCntW = floor($iAllW / $iBbCnt) + (($iAllW % $iBbCnt)? 1: 0); |
|
395 | - $iBdCnt = floor(($iAllW + $iBdCntW) / $iBbCnt) + ((($iAllW + $iBdCntW) % $iBbCnt)? 1: 0); |
|
394 | + $iBdCntW = floor($iAllW / $iBbCnt) + (($iAllW % $iBbCnt) ? 1 : 0); |
|
395 | + $iBdCnt = floor(($iAllW + $iBdCntW) / $iBbCnt) + ((($iAllW + $iBdCntW) % $iBbCnt) ? 1 : 0); |
|
396 | 396 | if ($iBdCnt <= ($iBdExL * $iBbCnt + $i1stBdL)) { |
397 | 397 | break; |
398 | 398 | } |
@@ -99,7 +99,7 @@ discard block |
||
99 | 99 | /** |
100 | 100 | * Implements support for fstat(). |
101 | 101 | * |
102 | - * @return bool |
|
102 | + * @return string |
|
103 | 103 | */ |
104 | 104 | public function statName() |
105 | 105 | { |
@@ -109,7 +109,7 @@ discard block |
||
109 | 109 | /** |
110 | 110 | * Implements support for fstat(). |
111 | 111 | * |
112 | - * @return bool |
|
112 | + * @return string |
|
113 | 113 | */ |
114 | 114 | public function url_stat() // @codingStandardsIgnoreLine |
115 | 115 | { |
@@ -166,7 +166,7 @@ discard block |
||
166 | 166 | * |
167 | 167 | * @param int $offset byte offset |
168 | 168 | * @param int $whence SEEK_SET, SEEK_CUR or SEEK_END |
169 | - * @return bool |
|
169 | + * @return boolean|null |
|
170 | 170 | */ |
171 | 171 | public function stream_seek($offset, $whence) // @codingStandardsIgnoreLine |
172 | 172 | { |
@@ -136,7 +136,7 @@ discard block |
||
136 | 136 | /** |
137 | 137 | * The workbook has macros ? |
138 | 138 | * |
139 | - * @return true if workbook has macros, false if not |
|
139 | + * @return boolean if workbook has macros, false if not |
|
140 | 140 | */ |
141 | 141 | public function hasMacros() |
142 | 142 | { |
@@ -177,7 +177,7 @@ discard block |
||
177 | 177 | /** |
178 | 178 | * Set the macros certificate |
179 | 179 | * |
180 | - * @param string|null $Certificate |
|
180 | + * @param string|null $certificate |
|
181 | 181 | */ |
182 | 182 | public function setMacrosCertificate($certificate = null) |
183 | 183 | { |
@@ -230,6 +230,7 @@ discard block |
||
230 | 230 | * retrieve ribbon XML Data |
231 | 231 | * |
232 | 232 | * return string|null|array |
233 | + * @return string |
|
233 | 234 | */ |
234 | 235 | public function getRibbonXMLData($what = 'all') //we need some constants here... |
235 | 236 | { |
@@ -303,7 +304,7 @@ discard block |
||
303 | 304 | /** |
304 | 305 | * This workbook have a custom UI ? |
305 | 306 | * |
306 | - * @return true|false |
|
307 | + * @return boolean |
|
307 | 308 | */ |
308 | 309 | public function hasRibbon() |
309 | 310 | { |
@@ -313,7 +314,7 @@ discard block |
||
313 | 314 | /** |
314 | 315 | * This workbook have additionnal object for the ribbon ? |
315 | 316 | * |
316 | - * @return true|false |
|
317 | + * @return boolean |
|
317 | 318 | */ |
318 | 319 | public function hasRibbonBinObjects() |
319 | 320 | { |
@@ -609,7 +610,7 @@ discard block |
||
609 | 610 | * |
610 | 611 | * @param Worksheet $pSheet |
611 | 612 | * @throws Exception |
612 | - * @return Sheet index |
|
613 | + * @return integer index |
|
613 | 614 | */ |
614 | 615 | public function getIndex(Worksheet $pSheet) |
615 | 616 | { |
@@ -628,7 +629,7 @@ discard block |
||
628 | 629 | * @param string $sheetName Sheet name to modify index for |
629 | 630 | * @param int $newIndex New index for the sheet |
630 | 631 | * @throws Exception |
631 | - * @return New sheet index |
|
632 | + * @return integer sheet index |
|
632 | 633 | */ |
633 | 634 | public function setIndexByName($sheetName, $newIndex) |
634 | 635 | { |
@@ -772,7 +773,7 @@ discard block |
||
772 | 773 | * Add named range |
773 | 774 | * |
774 | 775 | * @param NamedRange $namedRange |
775 | - * @return PhpSpreadsheet |
|
776 | + * @return boolean |
|
776 | 777 | */ |
777 | 778 | public function addNamedRange(NamedRange $namedRange) |
778 | 779 | { |
@@ -818,7 +819,7 @@ discard block |
||
818 | 819 | * |
819 | 820 | * @param string $namedRange |
820 | 821 | * @param Worksheet|null $pSheet Scope: use null for global scope. |
821 | - * @return PhpSpreadsheet |
|
822 | + * @return Spreadsheet |
|
822 | 823 | */ |
823 | 824 | public function removeNamedRange($namedRange, Worksheet $pSheet = null) |
824 | 825 | { |
@@ -838,7 +839,7 @@ discard block |
||
838 | 839 | /** |
839 | 840 | * Get worksheet iterator |
840 | 841 | * |
841 | - * @return WorksheetIterator |
|
842 | + * @return Worksheet\Iterator |
|
842 | 843 | */ |
843 | 844 | public function getWorksheetIterator() |
844 | 845 | { |
@@ -848,7 +849,7 @@ discard block |
||
848 | 849 | /** |
849 | 850 | * Copy workbook (!= clone!) |
850 | 851 | * |
851 | - * @return PhpSpreadsheet |
|
852 | + * @return Spreadsheet |
|
852 | 853 | */ |
853 | 854 | public function copy() |
854 | 855 | { |
@@ -228,7 +228,7 @@ |
||
228 | 228 | /** |
229 | 229 | * Set Rotation |
230 | 230 | * |
231 | - * @param float $pValue |
|
231 | + * @param integer $pValue |
|
232 | 232 | * @return Fill |
233 | 233 | */ |
234 | 234 | public function setRotation($pValue = 0) |
@@ -268,7 +268,7 @@ |
||
268 | 268 | /** |
269 | 269 | * Set Size |
270 | 270 | * |
271 | - * @param float $pValue |
|
271 | + * @param integer $pValue |
|
272 | 272 | * @return Font |
273 | 273 | */ |
274 | 274 | public function setSize($pValue = 10) |
@@ -68,7 +68,7 @@ discard block |
||
68 | 68 | /** |
69 | 69 | * Get ColumnIndex |
70 | 70 | * |
71 | - * @return string |
|
71 | + * @return integer |
|
72 | 72 | */ |
73 | 73 | public function getColumnIndex() |
74 | 74 | { |
@@ -101,7 +101,7 @@ discard block |
||
101 | 101 | /** |
102 | 102 | * Set Width |
103 | 103 | * |
104 | - * @param float $pValue |
|
104 | + * @param integer $pValue |
|
105 | 105 | * @return ColumnDimension |
106 | 106 | */ |
107 | 107 | public function setWidth($pValue = -1) |
@@ -101,7 +101,7 @@ |
||
101 | 101 | /** |
102 | 102 | * Set Row Height |
103 | 103 | * |
104 | - * @param float $pValue |
|
104 | + * @param integer $pValue |
|
105 | 105 | * @return RowDimension |
106 | 106 | */ |
107 | 107 | public function setRowHeight($pValue = -1) |