@@ -73,20 +73,16 @@ public function __construct(string $range = '', ?Worksheet $worksheet = null)
73
73
74
74
/**
75
75
* Get Table name.
76
- *
77
- * @return string
78
76
*/
79
- public function getName ()
77
+ public function getName (): string
80
78
{
81
79
return $ this ->name ;
82
80
}
83
81
84
82
/**
85
83
* Set Table name.
86
- *
87
- * @return $this
88
84
*/
89
- public function setName (string $ name )
85
+ public function setName (string $ name ): self
90
86
{
91
87
$ name = trim ($ name );
92
88
@@ -117,20 +113,16 @@ public function setName(string $name)
117
113
118
114
/**
119
115
* Get show Header Row.
120
- *
121
- * @return bool
122
116
*/
123
- public function getShowHeaderRow ()
117
+ public function getShowHeaderRow (): bool
124
118
{
125
119
return $ this ->showHeaderRow ;
126
120
}
127
121
128
122
/**
129
123
* Set show Header Row.
130
- *
131
- * @return $this
132
124
*/
133
- public function setShowHeaderRow (bool $ showHeaderRow )
125
+ public function setShowHeaderRow (bool $ showHeaderRow ): self
134
126
{
135
127
$ this ->showHeaderRow = $ showHeaderRow ;
136
128
@@ -139,20 +131,16 @@ public function setShowHeaderRow(bool $showHeaderRow)
139
131
140
132
/**
141
133
* Get show Totals Row.
142
- *
143
- * @return bool
144
134
*/
145
- public function getShowTotalsRow ()
135
+ public function getShowTotalsRow (): bool
146
136
{
147
137
return $ this ->showTotalsRow ;
148
138
}
149
139
150
140
/**
151
141
* Set show Totals Row.
152
- *
153
- * @return $this
154
142
*/
155
- public function setShowTotalsRow (bool $ showTotalsRow )
143
+ public function setShowTotalsRow (bool $ showTotalsRow ): self
156
144
{
157
145
$ this ->showTotalsRow = $ showTotalsRow ;
158
146
@@ -161,18 +149,14 @@ public function setShowTotalsRow(bool $showTotalsRow)
161
149
162
150
/**
163
151
* Get Table Range.
164
- *
165
- * @return string
166
152
*/
167
- public function getRange ()
153
+ public function getRange (): string
168
154
{
169
155
return $ this ->range ;
170
156
}
171
157
172
158
/**
173
159
* Set Table Cell Range.
174
- *
175
- * @return $this
176
160
*/
177
161
public function setRange (string $ range ): self
178
162
{
@@ -210,8 +194,6 @@ public function setRange(string $range): self
210
194
211
195
/**
212
196
* Set Table Cell Range to max row.
213
- *
214
- * @return $this
215
197
*/
216
198
public function setRangeToMaxRow (): self
217
199
{
@@ -228,20 +210,16 @@ public function setRangeToMaxRow(): self
228
210
229
211
/**
230
212
* Get Table's Worksheet.
231
- *
232
- * @return null|Worksheet
233
213
*/
234
- public function getWorksheet ()
214
+ public function getWorksheet (): ? Worksheet
235
215
{
236
216
return $ this ->workSheet ;
237
217
}
238
218
239
219
/**
240
220
* Set Table's Worksheet.
241
- *
242
- * @return $this
243
221
*/
244
- public function setWorksheet (?Worksheet $ worksheet = null )
222
+ public function setWorksheet (?Worksheet $ worksheet = null ): self
245
223
{
246
224
if ($ this ->name !== '' && $ worksheet !== null ) {
247
225
$ spreadsheet = $ worksheet ->getParent ();
@@ -265,7 +243,7 @@ public function setWorksheet(?Worksheet $worksheet = null)
265
243
*
266
244
* @return Table\Column[]
267
245
*/
268
- public function getColumns ()
246
+ public function getColumns (): array
269
247
{
270
248
return $ this ->columns ;
271
249
}
@@ -277,7 +255,7 @@ public function getColumns()
277
255
*
278
256
* @return int The column offset within the table range
279
257
*/
280
- public function isColumnInRange ($ column )
258
+ public function isColumnInRange (string $ column ): int
281
259
{
282
260
if (empty ($ this ->range )) {
283
261
throw new PhpSpreadsheetException ('No table range is defined. ' );
@@ -299,7 +277,7 @@ public function isColumnInRange($column)
299
277
*
300
278
* @return int The offset of the specified column within the table range
301
279
*/
302
- public function getColumnOffset ($ column )
280
+ public function getColumnOffset ($ column ): int
303
281
{
304
282
return $ this ->isColumnInRange ($ column );
305
283
}
@@ -308,10 +286,8 @@ public function getColumnOffset($column)
308
286
* Get a specified Table Column.
309
287
*
310
288
* @param string $column Column name (e.g. A)
311
- *
312
- * @return Table\Column
313
289
*/
314
- public function getColumn ($ column )
290
+ public function getColumn ($ column ): Table \ Column
315
291
{
316
292
$ this ->isColumnInRange ($ column );
317
293
@@ -326,10 +302,8 @@ public function getColumn($column)
326
302
* Get a specified Table Column by it's offset.
327
303
*
328
304
* @param int $columnOffset Column offset within range (starting from 0)
329
- *
330
- * @return Table\Column
331
305
*/
332
- public function getColumnByOffset ($ columnOffset )
306
+ public function getColumnByOffset ($ columnOffset ): Table \ Column
333
307
{
334
308
[$ rangeStart , $ rangeEnd ] = Coordinate::rangeBoundaries ($ this ->range );
335
309
$ pColumn = Coordinate::stringFromColumnIndex ($ rangeStart [0 ] + $ columnOffset );
@@ -342,10 +316,8 @@ public function getColumnByOffset($columnOffset)
342
316
*
343
317
* @param string|Table\Column $columnObjectOrString
344
318
* A simple string containing a Column ID like 'A' is permitted
345
- *
346
- * @return $this
347
319
*/
348
- public function setColumn ($ columnObjectOrString )
320
+ public function setColumn ($ columnObjectOrString ): self
349
321
{
350
322
if ((is_string ($ columnObjectOrString )) && (!empty ($ columnObjectOrString ))) {
351
323
$ column = $ columnObjectOrString ;
@@ -371,10 +343,8 @@ public function setColumn($columnObjectOrString)
371
343
* Clear a specified Table Column.
372
344
*
373
345
* @param string $column Column name (e.g. A)
374
- *
375
- * @return $this
376
346
*/
377
- public function clearColumn ($ column )
347
+ public function clearColumn ($ column ): self
378
348
{
379
349
$ this ->isColumnInRange ($ column );
380
350
@@ -394,10 +364,8 @@ public function clearColumn($column)
394
364
*
395
365
* @param string $fromColumn Column name (e.g. A)
396
366
* @param string $toColumn Column name (e.g. B)
397
- *
398
- * @return $this
399
367
*/
400
- public function shiftColumn ($ fromColumn , $ toColumn )
368
+ public function shiftColumn ($ fromColumn , $ toColumn ): self
401
369
{
402
370
$ fromColumn = strtoupper ($ fromColumn );
403
371
$ toColumn = strtoupper ($ toColumn );
@@ -417,20 +385,16 @@ public function shiftColumn($fromColumn, $toColumn)
417
385
418
386
/**
419
387
* Get table Style.
420
- *
421
- * @return TableStyle
422
388
*/
423
- public function getStyle ()
389
+ public function getStyle (): Table \ TableStyle
424
390
{
425
391
return $ this ->style ;
426
392
}
427
393
428
394
/**
429
395
* Set table Style.
430
- *
431
- * @return $this
432
396
*/
433
- public function setStyle (TableStyle $ style )
397
+ public function setStyle (TableStyle $ style ): self
434
398
{
435
399
$ this ->style = $ style ;
436
400
0 commit comments