@@ -1103,14 +1103,14 @@ public function getHighestRowAndColumn(): array
1103
1103
/**
1104
1104
* Set a cell value.
1105
1105
*
1106
- * @param array< int> |CellAddress|string $coordinate Coordinate of the cell as a string, eg: 'C5';
1106
+ * @param array{0: int, 1: int} |CellAddress|string $coordinate Coordinate of the cell as a string, eg: 'C5';
1107
1107
* or as an array of [$columnIndex, $row] (e.g. [3, 5]), or a CellAddress object.
1108
1108
* @param mixed $value Value for the cell
1109
1109
* @param null|IValueBinder $binder Value Binder to override the currently set Value Binder
1110
1110
*
1111
1111
* @return $this
1112
1112
*/
1113
- public function setCellValue ($ coordinate , mixed $ value , ?IValueBinder $ binder = null ): static
1113
+ public function setCellValue (CellAddress | string | array $ coordinate , mixed $ value , ?IValueBinder $ binder = null ): static
1114
1114
{
1115
1115
$ cellAddress = Functions::trimSheetFromCellReference (Validations::validateCellAddress ($ coordinate ));
1116
1116
$ this ->getCell ($ cellAddress )->setValue ($ value , $ binder );
@@ -1121,7 +1121,7 @@ public function setCellValue($coordinate, mixed $value, ?IValueBinder $binder =
1121
1121
/**
1122
1122
* Set a cell value.
1123
1123
*
1124
- * @param array< int> |CellAddress|string $coordinate Coordinate of the cell as a string, eg: 'C5';
1124
+ * @param array{0: int, 1: int} |CellAddress|string $coordinate Coordinate of the cell as a string, eg: 'C5';
1125
1125
* or as an array of [$columnIndex, $row] (e.g. [3, 5]), or a CellAddress object.
1126
1126
* @param mixed $value Value of the cell
1127
1127
* @param string $dataType Explicit data type, see DataType::TYPE_*
@@ -1135,7 +1135,7 @@ public function setCellValue($coordinate, mixed $value, ?IValueBinder $binder =
1135
1135
*
1136
1136
* @return $this
1137
1137
*/
1138
- public function setCellValueExplicit ($ coordinate , mixed $ value , string $ dataType ): static
1138
+ public function setCellValueExplicit (CellAddress | string | array $ coordinate , mixed $ value , string $ dataType ): static
1139
1139
{
1140
1140
$ cellAddress = Functions::trimSheetFromCellReference (Validations::validateCellAddress ($ coordinate ));
1141
1141
$ this ->getCell ($ cellAddress )->setValueExplicit ($ value , $ dataType );
@@ -1146,7 +1146,7 @@ public function setCellValueExplicit($coordinate, mixed $value, string $dataType
1146
1146
/**
1147
1147
* Get cell at a specific coordinate.
1148
1148
*
1149
- * @param array< int> |CellAddress|string $coordinate Coordinate of the cell as a string, eg: 'C5';
1149
+ * @param array{0: int, 1: int} |CellAddress|string $coordinate Coordinate of the cell as a string, eg: 'C5';
1150
1150
* or as an array of [$columnIndex, $row] (e.g. [3, 5]), or a CellAddress object.
1151
1151
*
1152
1152
* @return Cell Cell that was found or created
@@ -1156,7 +1156,7 @@ public function setCellValueExplicit($coordinate, mixed $value, string $dataType
1156
1156
* the "active" cell, and any previous assignment becomes a disconnected reference because
1157
1157
* the active cell has changed.
1158
1158
*/
1159
- public function getCell ($ coordinate ): Cell
1159
+ public function getCell (CellAddress | string | array $ coordinate ): Cell
1160
1160
{
1161
1161
$ cellAddress = Functions::trimSheetFromCellReference (Validations::validateCellAddress ($ coordinate ));
1162
1162
@@ -1299,10 +1299,10 @@ public function createNewCell(string $coordinate): Cell
1299
1299
/**
1300
1300
* Does the cell at a specific coordinate exist?
1301
1301
*
1302
- * @param array< int> |CellAddress|string $coordinate Coordinate of the cell as a string, eg: 'C5';
1302
+ * @param array{0: int, 1: int} |CellAddress|string $coordinate Coordinate of the cell as a string, eg: 'C5';
1303
1303
* or as an array of [$columnIndex, $row] (e.g. [3, 5]), or a CellAddress object.
1304
1304
*/
1305
- public function cellExists ($ coordinate ): bool
1305
+ public function cellExists (CellAddress | string | array $ coordinate ): bool
1306
1306
{
1307
1307
$ cellAddress = Validations::validateCellAddress ($ coordinate );
1308
1308
[$ sheet , $ finalCoordinate ] = $ this ->getWorksheetAndCoordinate ($ cellAddress );
@@ -1388,7 +1388,7 @@ public function getStyles(): array
1388
1388
* or passing in an array of [$fromColumnIndex, $fromRow, $toColumnIndex, $toRow] (e.g. [3, 5, 6, 8]),
1389
1389
* or a CellAddress or AddressRange object.
1390
1390
*/
1391
- public function getStyle ($ cellCoordinate ): Style
1391
+ public function getStyle (AddressRange | CellAddress | int | string | array $ cellCoordinate ): Style
1392
1392
{
1393
1393
$ cellCoordinate = Validations::validateCellOrCellRange ($ cellCoordinate );
1394
1394
@@ -1589,13 +1589,13 @@ public function duplicateConditionalStyle(array $styles, string $range = ''): st
1589
1589
/**
1590
1590
* Set break on a cell.
1591
1591
*
1592
- * @param array< int> |CellAddress|string $coordinate Coordinate of the cell as a string, eg: 'C5';
1592
+ * @param array{0: int, 1: int} |CellAddress|string $coordinate Coordinate of the cell as a string, eg: 'C5';
1593
1593
* or as an array of [$columnIndex, $row] (e.g. [3, 5]), or a CellAddress object.
1594
1594
* @param int $break Break type (type of Worksheet::BREAK_*)
1595
1595
*
1596
1596
* @return $this
1597
1597
*/
1598
- public function setBreak ($ coordinate , int $ break , int $ max = -1 ): static
1598
+ public function setBreak (CellAddress | string | array $ coordinate , int $ break , int $ max = -1 ): static
1599
1599
{
1600
1600
$ cellAddress = Functions::trimSheetFromCellReference (Validations::validateCellAddress ($ coordinate ));
1601
1601
@@ -1692,7 +1692,7 @@ public function getColumnBreaks(): array
1692
1692
*
1693
1693
* @return $this
1694
1694
*/
1695
- public function mergeCells ($ range , string $ behaviour = self ::MERGE_CELL_CONTENT_EMPTY ): static
1695
+ public function mergeCells (AddressRange | string | array $ range , string $ behaviour = self ::MERGE_CELL_CONTENT_EMPTY ): static
1696
1696
{
1697
1697
$ range = Functions::trimSheetFromCellReference (Validations::validateCellRange ($ range ));
1698
1698
@@ -1812,7 +1812,7 @@ public function mergeCellBehaviour(Cell $cell, string $upperLeft, string $behavi
1812
1812
*
1813
1813
* @return $this
1814
1814
*/
1815
- public function unmergeCells ($ range ): static
1815
+ public function unmergeCells (AddressRange | string | array $ range ): static
1816
1816
{
1817
1817
$ range = Functions::trimSheetFromCellReference (Validations::validateCellRange ($ range ));
1818
1818
@@ -1865,7 +1865,7 @@ public function setMergeCells(array $mergeCells): static
1865
1865
*
1866
1866
* @return $this
1867
1867
*/
1868
- public function protectCells ($ range , string $ password , bool $ alreadyHashed = false ): static
1868
+ public function protectCells (AddressRange | CellAddress | int | string | array $ range , string $ password , bool $ alreadyHashed = false ): static
1869
1869
{
1870
1870
$ range = Functions::trimSheetFromCellReference (Validations::validateCellOrCellRange ($ range ));
1871
1871
@@ -1886,7 +1886,7 @@ public function protectCells($range, string $password, bool $alreadyHashed = fal
1886
1886
*
1887
1887
* @return $this
1888
1888
*/
1889
- public function unprotectCells ($ range ): static
1889
+ public function unprotectCells (AddressRange | CellAddress | int | string | array $ range ): static
1890
1890
{
1891
1891
$ range = Functions::trimSheetFromCellReference (Validations::validateCellOrCellRange ($ range ));
1892
1892
@@ -1927,7 +1927,7 @@ public function getAutoFilter(): AutoFilter
1927
1927
*
1928
1928
* @return $this
1929
1929
*/
1930
- public function setAutoFilter ($ autoFilterOrRange ): static
1930
+ public function setAutoFilter (AddressRange | string | array | AutoFilter $ autoFilterOrRange ): static
1931
1931
{
1932
1932
if (is_object ($ autoFilterOrRange ) && ($ autoFilterOrRange instanceof AutoFilter)) {
1933
1933
$ this ->autoFilter = $ autoFilterOrRange ;
@@ -2063,16 +2063,16 @@ public function getFreezePane(): ?string
2063
2063
* - B1 will freeze the columns to the left of cell B1 (i.e column A)
2064
2064
* - B2 will freeze the rows above and to the left of cell B2 (i.e row 1 and column A)
2065
2065
*
2066
- * @param null|array< int> |CellAddress|string $coordinate Coordinate of the cell as a string, eg: 'C5';
2066
+ * @param null|array{0: int, 1: int} |CellAddress|string $coordinate Coordinate of the cell as a string, eg: 'C5';
2067
2067
* or as an array of [$columnIndex, $row] (e.g. [3, 5]), or a CellAddress object.
2068
2068
* Passing a null value for this argument will clear any existing freeze pane for this worksheet.
2069
- * @param null|array< int> |CellAddress|string $topLeftCell default position of the right bottom pane
2069
+ * @param null|array{0: int, 1: int} |CellAddress|string $topLeftCell default position of the right bottom pane
2070
2070
* Coordinate of the cell as a string, eg: 'C5'; or as an array of [$columnIndex, $row] (e.g. [3, 5]),
2071
2071
* or a CellAddress object.
2072
2072
*
2073
2073
* @return $this
2074
2074
*/
2075
- public function freezePane ($ coordinate , $ topLeftCell = null , bool $ frozenSplit = false ): static
2075
+ public function freezePane (null | CellAddress | string | array $ coordinate , null | CellAddress | string | array $ topLeftCell = null , bool $ frozenSplit = false ): static
2076
2076
{
2077
2077
$ this ->panes = [
2078
2078
'bottomRight ' => null ,
@@ -2577,12 +2577,12 @@ public function setComments(array $comments): self
2577
2577
/**
2578
2578
* Remove comment from cell.
2579
2579
*
2580
- * @param array< int> |CellAddress|string $cellCoordinate Coordinate of the cell as a string, eg: 'C5';
2580
+ * @param array{0: int, 1: int} |CellAddress|string $cellCoordinate Coordinate of the cell as a string, eg: 'C5';
2581
2581
* or as an array of [$columnIndex, $row] (e.g. [3, 5]), or a CellAddress object.
2582
2582
*
2583
2583
* @return $this
2584
2584
*/
2585
- public function removeComment ($ cellCoordinate ): self
2585
+ public function removeComment (CellAddress | string | array $ cellCoordinate ): self
2586
2586
{
2587
2587
$ cellAddress = Functions::trimSheetFromCellReference (Validations::validateCellAddress ($ cellCoordinate ));
2588
2588
@@ -2604,10 +2604,10 @@ public function removeComment($cellCoordinate): self
2604
2604
/**
2605
2605
* Get comment for cell.
2606
2606
*
2607
- * @param array< int> |CellAddress|string $cellCoordinate Coordinate of the cell as a string, eg: 'C5';
2607
+ * @param array{0: int, 1: int} |CellAddress|string $cellCoordinate Coordinate of the cell as a string, eg: 'C5';
2608
2608
* or as an array of [$columnIndex, $row] (e.g. [3, 5]), or a CellAddress object.
2609
2609
*/
2610
- public function getComment ($ cellCoordinate ): Comment
2610
+ public function getComment (CellAddress | string | array $ cellCoordinate ): Comment
2611
2611
{
2612
2612
$ cellAddress = Functions::trimSheetFromCellReference (Validations::validateCellAddress ($ cellCoordinate ));
2613
2613
@@ -2670,7 +2670,7 @@ public function setSelectedCell(string $coordinate): static
2670
2670
*
2671
2671
* @return $this
2672
2672
*/
2673
- public function setSelectedCells ($ coordinate ): static
2673
+ public function setSelectedCells (AddressRange | CellAddress | int | string | array $ coordinate ): static
2674
2674
{
2675
2675
if (is_string ($ coordinate )) {
2676
2676
$ coordinate = Validations::definedNameToCoordinate ($ coordinate , $ this );
0 commit comments