Add feature removeComment

Use $cellCoordinate as argument
Return $this to support the fluent interface
This commit is contained in:
Dams 2022-06-14 10:12:08 +02:00 committed by GitHub
parent 801f5296e9
commit 861b955b3b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 2 deletions

View File

@ -2588,9 +2588,9 @@ class Worksheet implements IComparable
* @param array<int>|CellAddress|string $cellCoordinate Coordinate of the cell as a string, eg: 'C5'; * @param array<int>|CellAddress|string $cellCoordinate Coordinate of the cell as a string, eg: 'C5';
* or as an array of [$columnIndex, $row] (e.g. [3, 5]), or a CellAddress object. * or as an array of [$columnIndex, $row] (e.g. [3, 5]), or a CellAddress object.
* *
* @return Comment * @return $this
*/ */
public function removeComment($cellCoordinate):void public function removeComment($cellCoordinate)
{ {
$cellAddress = Functions::trimSheetFromCellReference(Validations::validateCellAddress($cellCoordinate)); $cellAddress = Functions::trimSheetFromCellReference(Validations::validateCellAddress($cellCoordinate));
@ -2605,6 +2605,8 @@ class Worksheet implements IComparable
if (isset($this->comments[$cellAddress])) { if (isset($this->comments[$cellAddress])) {
unset($this->comments[$cellAddress]); unset($this->comments[$cellAddress]);
} }
return $this;
} }
/** /**