Skip to content

Commit 1b27d9c

Browse files
committed
Stronger typing for newly introduced methods
1 parent 627f76a commit 1b27d9c

File tree

3 files changed

+4
-20
lines changed

3 files changed

+4
-20
lines changed

src/PhpSpreadsheet/Reader/BaseReader.php

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -204,12 +204,8 @@ protected function openFile(string $filename): void
204204

205205
/**
206206
* Return worksheet info (Name, Last Column Letter, Last Column Index, Total Rows, Total Columns).
207-
*
208-
* @param string $filename
209-
*
210-
* @return array
211207
*/
212-
public function listWorksheetInfo($filename)
208+
public function listWorksheetInfo(string $filename): array
213209
{
214210
throw new PhpSpreadsheetException('Reader classes must implement their own listWorksheetInfo() method');
215211
}
@@ -219,12 +215,8 @@ public function listWorksheetInfo($filename)
219215
* possibly without parsing the whole file to a Spreadsheet object.
220216
* Readers will often have a more efficient method with which
221217
* they can override this method.
222-
*
223-
* @param string $filename
224-
*
225-
* @return array
226218
*/
227-
public function listWorksheetNames($filename)
219+
public function listWorksheetNames(string $filename): array
228220
{
229221
$returnArray = [];
230222
$info = $this->listWorksheetInfo($filename);

src/PhpSpreadsheet/Reader/Csv.php

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -216,12 +216,8 @@ protected function inferSeparator(): void
216216

217217
/**
218218
* Return worksheet info (Name, Last Column Letter, Last Column Index, Total Rows, Total Columns).
219-
*
220-
* @param string $filename
221-
*
222-
* @return array
223219
*/
224-
public function listWorksheetInfo($filename)
220+
public function listWorksheetInfo(string $filename): array
225221
{
226222
// Open file
227223
$this->openFileOrMemory($filename);

src/PhpSpreadsheet/Reader/Html.php

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1167,12 +1167,8 @@ private function setBorderStyle(Style $cellStyle, string $styleValue, string $ty
11671167

11681168
/**
11691169
* Return worksheet info (Name, Last Column Letter, Last Column Index, Total Rows, Total Columns).
1170-
*
1171-
* @param string $filename
1172-
*
1173-
* @return array
11741170
*/
1175-
public function listWorksheetInfo($filename)
1171+
public function listWorksheetInfo(string $filename): array
11761172
{
11771173
$info = [];
11781174
$spreadsheet = new Spreadsheet();

0 commit comments

Comments
 (0)