Skip to content

Commit 6bae227

Browse files
committed
Improved a few comments
1 parent fd6c7a5 commit 6bae227

File tree

3 files changed

+27
-27
lines changed

3 files changed

+27
-27
lines changed

src/XlsxFastEditor.php

Lines changed: 25 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,7 @@ private function getDomFromPath(string $path): \DOMDocument
185185
* Excel can either use a base date from year 1900 (Microsoft Windows) or from year 1904 (old Apple MacOS).
186186
* https://support.microsoft.com/en-us/office/date-systems-in-excel-e7fe7167-48a9-4b96-bb53-5612a800b487
187187
* @phpstan-return 1900|1904
188-
* @return int 1900 or 1904
188+
* @return int `1900` or `1904`
189189
* @throws XlsxFastEditorFileFormatException
190190
* @throws XlsxFastEditorXmlException
191191
*/
@@ -271,7 +271,7 @@ public function getWorksheetCount(): int
271271
/**
272272
* Get a worksheet number (ID) from its name (base 1).
273273
* @param string $sheetName The name of the worksheet to look up.
274-
* @return int The worksheet ID, or -1 if not found.
274+
* @return int The worksheet ID, or `-1` if not found.
275275
* @throws XlsxFastEditorFileFormatException
276276
* @throws XlsxFastEditorXmlException
277277
*/
@@ -288,7 +288,7 @@ public function getWorksheetNumber(string $sheetName): int
288288
/**
289289
* Get a worksheet name from its number (ID).
290290
* @param int $sheetNumber The number of the worksheet to look up.
291-
* @return string|null The worksheet name, or null if not found.
291+
* @return string|null The worksheet name, or `null` if not found.
292292
* @throws XlsxFastEditorFileFormatException
293293
* @throws XlsxFastEditorXmlException
294294
*/
@@ -452,7 +452,7 @@ public function getLastRow(int $sheetNumber): ?XlsxFastEditorRow
452452
/**
453453
* Delete the specified row of the specified worksheet.
454454
* @param int $sheetNumber Worksheet number (base 1)
455-
* @return bool True if the deletion succeeds, false otherwise.
455+
* @return bool `true` if the deletion succeeds, `false` otherwise.
456456
* @throws XlsxFastEditorFileFormatException
457457
* @throws XlsxFastEditorXmlException
458458
*/
@@ -492,7 +492,7 @@ public function rowsIterator(int $sheetNumber): \Traversable
492492
}
493493

494494
/**
495-
* Produce an array from a worksheet, indexed by column name (like `AB`) first, then line (like `12`).
495+
* Produce an array from a worksheet, indexed by column name (like `'AB'`) first, then line (like `12`).
496496
* Only the existing lines and cells are included.
497497
* @return array<string,array<int,null|string>> An array that can be accessed like `$array['AB'][12]`
498498
* @throws XlsxFastEditorFileFormatException
@@ -510,7 +510,7 @@ public function readArray(int $sheetNumber): array
510510
}
511511

512512
/**
513-
* Produce an array from a worksheet, indexed by column header (like `columnName`) first, then line (like `12`),
513+
* Produce an array from a worksheet, indexed by column header (like `'columnName'`) first, then line (like `12`),
514514
* having the column header defined in the first existing line of the spreadsheet.
515515
* Only the existing lines and cells are included.
516516
* @return array<string,array<int,null|string>> An array that can be accessed like `$array['columnName'][12]`
@@ -539,10 +539,10 @@ public function readArrayWithHeaders(int $sheetNumber): array
539539
}
540540

541541
/**
542-
* Sort cells (such as `B3`, `AA23`) on column first (such as `B`, `AA`) and then line (such as `3`, `23`).
543-
* @param $ref1 A cell reference such as `B3`
544-
* @param $ref1 A cell reference such as `AA23`
545-
* @return int -1 if $ref1 is before $ref2; 1 if $ref1 is greater than $ref2, and 0 if they are equal.
542+
* Sort cells (such as `'B3'`, `'AA23'`) on column first (such as `'B'`, `'AA'`) and then line (such as `3`, `23`).
543+
* @param $ref1 A cell reference such as `'B3'`
544+
* @param $ref1 A cell reference such as `'AA23'`
545+
* @return int `<0` if $ref1 is before $ref2; `>0` if $ref1 is greater than $ref2, and `0` if they are equal.
546546
*/
547547
public static function cellOrderCompare(string $ref1, string $ref2): int
548548
{
@@ -581,7 +581,7 @@ public static function cellOrderCompare(string $ref1, string $ref2): int
581581
* `XlsxFastEditorRow::getNextRow()`, `XlsxFastEditorRow::getFirstCell()`, `XlsxFastEditorCell::getNextCell()`, etc.
582582
*
583583
* @param int $sheetNumber Worksheet number (base 1)
584-
* @param string $cellName Cell name such as `B4`
584+
* @param string $cellName Cell name such as `'B4'`
585585
* @param int $accessMode To control the behaviour when the cell does not exist:
586586
* set to `XlsxFastEditor::ACCESS_MODE_NULL` to return `null` (default),
587587
* set to `XlsxFastEditor::ACCESS_MODE_EXCEPTION` to raise an `XlsxFastEditorInputException` exception,
@@ -634,14 +634,14 @@ public function getCell(int $sheetNumber, string $cellName, int $accessMode = Xl
634634
}
635635

636636
/**
637-
* Access the specified cell in the specified worksheet, or null if if does not exist.
637+
* Access the specified cell in the specified worksheet, or `null` if if does not exist.
638638
*
639639
* ℹ️ Instead of calling multiple times this function, consider the faster navigation methods
640640
* `XlsxFastEditor::rowsIterator()`, `XlsxFastEditor::getFirstRow()`, `XlsxFastEditorRow::cellsIterator()`,
641641
* `XlsxFastEditorRow::getNextRow()`, `XlsxFastEditorRow::getFirstCell()`, `XlsxFastEditorCell::getNextCell()`, etc.
642642
*
643643
* @param int $sheetNumber Worksheet number (base 1)
644-
* @param string $cellName Cell name such as `B4`
644+
* @param string $cellName Cell name such as `'B4'`
645645
* @return XlsxFastEditorCell|null A cell, potentially `null` if the cell does not exist
646646
* @throws \InvalidArgumentException if `$cellName` has an invalid format
647647
* @throws XlsxFastEditorFileFormatException
@@ -661,7 +661,7 @@ public function getCellOrNull(int $sheetNumber, string $cellName): ?XlsxFastEdit
661661
* Access the specified cell in the specified worksheet, or autocreate it if it does not already exist.
662662
* The corresponding row can also be automatically created if it does not exist already, but the worksheet cannot be automatically created.
663663
* @param int $sheetNumber Worksheet number (base 1)
664-
* @param string $cellName Cell name such as `B4`
664+
* @param string $cellName Cell name such as `'B4'`
665665
* @return XlsxFastEditorCell A cell
666666
* @throws \InvalidArgumentException if `$cellName` has an invalid format
667667
* @throws XlsxFastEditorFileFormatException
@@ -681,7 +681,7 @@ public function getCellAutocreate(int $sheetNumber, string $cellName): XlsxFastE
681681
* Read a formula in the given worksheet at the given cell location.
682682
*
683683
* @param int $sheetNumber Worksheet number (base 1)
684-
* @param string $cellName Cell name such as `B4`
684+
* @param string $cellName Cell name such as `'B4'`
685685
* @return string|null an integer if the cell exists and contains a formula, `null` otherwise.
686686
* @throws \InvalidArgumentException if `$cellName` has an invalid format
687687
* @throws XlsxFastEditorFileFormatException
@@ -697,7 +697,7 @@ public function readFormula(int $sheetNumber, string $cellName): ?string
697697
* Read a float in the given worksheet at the given cell location.
698698
*
699699
* @param int $sheetNumber Worksheet number (base 1)
700-
* @param string $cellName Cell name such as `B4`
700+
* @param string $cellName Cell name such as `'B4'`
701701
* @return float|null a float if the cell exists and contains a number, `null` otherwise.
702702
* @throws \InvalidArgumentException if `$cellName` has an invalid format
703703
* @throws XlsxFastEditorFileFormatException
@@ -713,7 +713,7 @@ public function readFloat(int $sheetNumber, string $cellName): ?float
713713
* Read a date/time in the given worksheet at the given cell location.
714714
*
715715
* @param int $sheetNumber Worksheet number (base 1)
716-
* @param string $cellName Cell name such as `B4`
716+
* @param string $cellName Cell name such as `'B4'`
717717
* @return \DateTimeImmutable|null a date if the cell exists and contains a number, `null` otherwise.
718718
* @throws \InvalidArgumentException if `$cellName` has an invalid format
719719
* @throws XlsxFastEditorFileFormatException
@@ -729,7 +729,7 @@ public function readDateTime(int $sheetNumber, string $cellName): ?\DateTimeImmu
729729
* Read an integer in the given worksheet at the given cell location.
730730
*
731731
* @param int $sheetNumber Worksheet number (base 1)
732-
* @param string $cellName Cell name such as `B4`
732+
* @param string $cellName Cell name such as `'B4'`
733733
* @return int|null an integer if the cell exists and contains a number, `null` otherwise.
734734
* @throws \InvalidArgumentException if `$cellName` has an invalid format
735735
* @throws XlsxFastEditorFileFormatException
@@ -769,7 +769,7 @@ public function _getSharedString(int $stringNumber): ?string
769769
* compatible with the shared string approach.
770770
*
771771
* @param int $sheetNumber Worksheet number (base 1)
772-
* @param string $cellName Cell name such as `B4`
772+
* @param string $cellName Cell name such as `'B4'`
773773
* @return string|null a string if the cell exists and contains a value, `null` otherwise.
774774
* @throws \InvalidArgumentException if `$cellName` has an invalid format
775775
* @throws XlsxFastEditorFileFormatException
@@ -812,7 +812,7 @@ public function _getHyperlink(int $sheetNumber, string $rId): ?string
812812
* Read a hyperlink in the given worksheet at the given cell location.
813813
*
814814
* @param int $sheetNumber Worksheet number (base 1)
815-
* @param string $cellName Cell name such as `B4`
815+
* @param string $cellName Cell name such as `'B4'`
816816
* @return string|null a string if the cell exists and contains a hyperlink, `null` otherwise.
817817
* @throws \InvalidArgumentException if `$cellName` has an invalid format
818818
* @throws XlsxFastEditorFileFormatException
@@ -860,7 +860,7 @@ public function _setHyperlink(int $sheetNumber, string $rId, string $value): boo
860860
* Warning: does not support the creation of a new hyperlink.
861861
*
862862
* @param int $sheetNumber Worksheet number (base 1)
863-
* @param string $cellName Cell name such as `B4`
863+
* @param string $cellName Cell name such as `'B4'`
864864
* @return bool True if the hyperlink could be replaced, false otherwise.
865865
* @throws \InvalidArgumentException if `$cellName` has an invalid format
866866
* @throws XlsxFastEditorFileFormatException
@@ -878,7 +878,7 @@ public function writeHyperlink(int $sheetNumber, string $cellName, string $value
878878
* Removes the formulas of the cell, if any.
879879
*
880880
* @param int $sheetNumber Worksheet number (base 1)
881-
* @param string $cellName Cell name such as `B4`
881+
* @param string $cellName Cell name such as `'B4'`
882882
* @throws \InvalidArgumentException if `$cellName` has an invalid format
883883
* @throws XlsxFastEditorFileFormatException
884884
* @throws XlsxFastEditorXmlException
@@ -895,7 +895,7 @@ public function writeFormula(int $sheetNumber, string $cellName, string $value):
895895
* Removes the formulas of the cell, if any.
896896
*
897897
* @param int $sheetNumber Worksheet number (base 1)
898-
* @param string $cellName Cell name such as `B4`
898+
* @param string $cellName Cell name such as `'B4'`
899899
* @param float $value
900900
* @throws \InvalidArgumentException if `$cellName` has an invalid format
901901
* @throws XlsxFastEditorFileFormatException
@@ -913,7 +913,7 @@ public function writeFloat(int $sheetNumber, string $cellName, float $value): vo
913913
* Removes the formulas of the cell, if any.
914914
*
915915
* @param int $sheetNumber Worksheet number (base 1)
916-
* @param string $cellName Cell name such as `B4`
916+
* @param string $cellName Cell name such as `'B4'`
917917
* @param int $value
918918
* @throws \InvalidArgumentException if `$cellName` has an invalid format
919919
* @throws XlsxFastEditorFileFormatException
@@ -976,7 +976,7 @@ public function _makeNewSharedString(string $value): int
976976
* Removes the formulas of the cell, if any.
977977
*
978978
* @param int $sheetNumber Worksheet number (base 1)
979-
* @param string $cellName Cell name such as `B4`
979+
* @param string $cellName Cell name such as `'B4'`
980980
* @throws \InvalidArgumentException if `$cellName` has an invalid format
981981
* @throws XlsxFastEditorFileFormatException
982982
* @throws XlsxFastEditorXmlException

src/XlsxFastEditorCell.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -228,7 +228,7 @@ public function readHyperlink(): ?string
228228

229229
/**
230230
* Clean the cell to have its value written.
231-
* @return \DOMElement The `<v>` value element of the provided cell, or null in case of error.
231+
* @return \DOMElement The `<v>` value element of the provided cell, or `null` in case of error.
232232
* @throws XlsxFastEditorXmlException
233233
*/
234234
private function initCellValue(): \DOMElement

src/XlsxFastEditorRow.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,7 @@ public function getCell(string $cellName, int $accessMode = XlsxFastEditor::ACCE
187187
}
188188

189189
/**
190-
* Get the cell of the given name, or null if if does not exist.
190+
* Get the cell of the given name, or `null` if if does not exist.
191191
*
192192
* ℹ️ Instead of calling multiple times this function, consider the faster navigation methods
193193
* `XlsxFastEditorRow::cellsIterator()`, `XlsxFastEditorRow::getFirstCell()`, `XlsxFastEditorCell::getNextCell()`, etc.

0 commit comments

Comments
 (0)