@@ -73,20 +73,16 @@ public function __construct(string $range = '', ?Worksheet $worksheet = null)
7373
7474 /**
7575 * Get Table name.
76- *
77- * @return string
7876 */
79- public function getName ()
77+ public function getName (): string
8078 {
8179 return $ this ->name ;
8280 }
8381
8482 /**
8583 * Set Table name.
86- *
87- * @return $this
8884 */
89- public function setName (string $ name )
85+ public function setName (string $ name ): self
9086 {
9187 $ name = trim ($ name );
9288
@@ -117,20 +113,16 @@ public function setName(string $name)
117113
118114 /**
119115 * Get show Header Row.
120- *
121- * @return bool
122116 */
123- public function getShowHeaderRow ()
117+ public function getShowHeaderRow (): bool
124118 {
125119 return $ this ->showHeaderRow ;
126120 }
127121
128122 /**
129123 * Set show Header Row.
130- *
131- * @return $this
132124 */
133- public function setShowHeaderRow (bool $ showHeaderRow )
125+ public function setShowHeaderRow (bool $ showHeaderRow ): self
134126 {
135127 $ this ->showHeaderRow = $ showHeaderRow ;
136128
@@ -139,20 +131,16 @@ public function setShowHeaderRow(bool $showHeaderRow)
139131
140132 /**
141133 * Get show Totals Row.
142- *
143- * @return bool
144134 */
145- public function getShowTotalsRow ()
135+ public function getShowTotalsRow (): bool
146136 {
147137 return $ this ->showTotalsRow ;
148138 }
149139
150140 /**
151141 * Set show Totals Row.
152- *
153- * @return $this
154142 */
155- public function setShowTotalsRow (bool $ showTotalsRow )
143+ public function setShowTotalsRow (bool $ showTotalsRow ): self
156144 {
157145 $ this ->showTotalsRow = $ showTotalsRow ;
158146
@@ -161,18 +149,14 @@ public function setShowTotalsRow(bool $showTotalsRow)
161149
162150 /**
163151 * Get Table Range.
164- *
165- * @return string
166152 */
167- public function getRange ()
153+ public function getRange (): string
168154 {
169155 return $ this ->range ;
170156 }
171157
172158 /**
173159 * Set Table Cell Range.
174- *
175- * @return $this
176160 */
177161 public function setRange (string $ range ): self
178162 {
@@ -210,8 +194,6 @@ public function setRange(string $range): self
210194
211195 /**
212196 * Set Table Cell Range to max row.
213- *
214- * @return $this
215197 */
216198 public function setRangeToMaxRow (): self
217199 {
@@ -228,20 +210,16 @@ public function setRangeToMaxRow(): self
228210
229211 /**
230212 * Get Table's Worksheet.
231- *
232- * @return null|Worksheet
233213 */
234- public function getWorksheet ()
214+ public function getWorksheet (): ? Worksheet
235215 {
236216 return $ this ->workSheet ;
237217 }
238218
239219 /**
240220 * Set Table's Worksheet.
241- *
242- * @return $this
243221 */
244- public function setWorksheet (?Worksheet $ worksheet = null )
222+ public function setWorksheet (?Worksheet $ worksheet = null ): self
245223 {
246224 if ($ this ->name !== '' && $ worksheet !== null ) {
247225 $ spreadsheet = $ worksheet ->getParent ();
@@ -265,7 +243,7 @@ public function setWorksheet(?Worksheet $worksheet = null)
265243 *
266244 * @return Table\Column[]
267245 */
268- public function getColumns ()
246+ public function getColumns (): array
269247 {
270248 return $ this ->columns ;
271249 }
@@ -277,7 +255,7 @@ public function getColumns()
277255 *
278256 * @return int The column offset within the table range
279257 */
280- public function isColumnInRange ($ column )
258+ public function isColumnInRange (string $ column ): int
281259 {
282260 if (empty ($ this ->range )) {
283261 throw new PhpSpreadsheetException ('No table range is defined. ' );
@@ -299,7 +277,7 @@ public function isColumnInRange($column)
299277 *
300278 * @return int The offset of the specified column within the table range
301279 */
302- public function getColumnOffset ($ column )
280+ public function getColumnOffset ($ column ): int
303281 {
304282 return $ this ->isColumnInRange ($ column );
305283 }
@@ -308,10 +286,8 @@ public function getColumnOffset($column)
308286 * Get a specified Table Column.
309287 *
310288 * @param string $column Column name (e.g. A)
311- *
312- * @return Table\Column
313289 */
314- public function getColumn ($ column )
290+ public function getColumn ($ column ): Table \ Column
315291 {
316292 $ this ->isColumnInRange ($ column );
317293
@@ -326,10 +302,8 @@ public function getColumn($column)
326302 * Get a specified Table Column by it's offset.
327303 *
328304 * @param int $columnOffset Column offset within range (starting from 0)
329- *
330- * @return Table\Column
331305 */
332- public function getColumnByOffset ($ columnOffset )
306+ public function getColumnByOffset ($ columnOffset ): Table \ Column
333307 {
334308 [$ rangeStart , $ rangeEnd ] = Coordinate::rangeBoundaries ($ this ->range );
335309 $ pColumn = Coordinate::stringFromColumnIndex ($ rangeStart [0 ] + $ columnOffset );
@@ -342,10 +316,8 @@ public function getColumnByOffset($columnOffset)
342316 *
343317 * @param string|Table\Column $columnObjectOrString
344318 * A simple string containing a Column ID like 'A' is permitted
345- *
346- * @return $this
347319 */
348- public function setColumn ($ columnObjectOrString )
320+ public function setColumn ($ columnObjectOrString ): self
349321 {
350322 if ((is_string ($ columnObjectOrString )) && (!empty ($ columnObjectOrString ))) {
351323 $ column = $ columnObjectOrString ;
@@ -371,10 +343,8 @@ public function setColumn($columnObjectOrString)
371343 * Clear a specified Table Column.
372344 *
373345 * @param string $column Column name (e.g. A)
374- *
375- * @return $this
376346 */
377- public function clearColumn ($ column )
347+ public function clearColumn ($ column ): self
378348 {
379349 $ this ->isColumnInRange ($ column );
380350
@@ -394,10 +364,8 @@ public function clearColumn($column)
394364 *
395365 * @param string $fromColumn Column name (e.g. A)
396366 * @param string $toColumn Column name (e.g. B)
397- *
398- * @return $this
399367 */
400- public function shiftColumn ($ fromColumn , $ toColumn )
368+ public function shiftColumn ($ fromColumn , $ toColumn ): self
401369 {
402370 $ fromColumn = strtoupper ($ fromColumn );
403371 $ toColumn = strtoupper ($ toColumn );
@@ -417,20 +385,16 @@ public function shiftColumn($fromColumn, $toColumn)
417385
418386 /**
419387 * Get table Style.
420- *
421- * @return TableStyle
422388 */
423- public function getStyle ()
389+ public function getStyle (): Table \ TableStyle
424390 {
425391 return $ this ->style ;
426392 }
427393
428394 /**
429395 * Set table Style.
430- *
431- * @return $this
432396 */
433- public function setStyle (TableStyle $ style )
397+ public function setStyle (TableStyle $ style ): self
434398 {
435399 $ this ->style = $ style ;
436400
0 commit comments