22
33namespace PhpOffice \PhpSpreadsheet \Reader ;
44
5+ use PhpOffice \PhpSpreadsheet \Spreadsheet ;
6+
57interface IReader
68{
79 public const LOAD_WITH_CHARTS = 1 ;
810
9- /**
10- * IReader constructor.
11- */
12- public function __construct ();
13-
1411 /**
1512 * Can the current IReader read the file?
1613 */
@@ -20,110 +17,82 @@ public function canRead(string $filename): bool;
2017 * Read data only?
2118 * If this is true, then the Reader will only read data values for cells, it will not read any formatting information.
2219 * If false (the default) it will read data and formatting.
23- *
24- * @return bool
2520 */
26- public function getReadDataOnly ();
21+ public function getReadDataOnly (): bool ;
2722
2823 /**
2924 * Set read data only
3025 * Set to true, to advise the Reader only to read data values for cells, and to ignore any formatting information.
3126 * Set to false (the default) to advise the Reader to read both data and formatting for cells.
32- *
33- * @param bool $readDataOnly
34- *
35- * @return IReader
3627 */
37- public function setReadDataOnly ($ readDataOnly );
28+ public function setReadDataOnly (bool $ readDataOnly ): self ;
3829
3930 /**
4031 * Read empty cells?
4132 * If this is true (the default), then the Reader will read data values for all cells, irrespective of value.
4233 * If false it will not read data for cells containing a null value or an empty string.
43- *
44- * @return bool
4534 */
46- public function getReadEmptyCells ();
35+ public function getReadEmptyCells (): bool ;
4736
4837 /**
4938 * Set read empty cells
5039 * Set to true (the default) to advise the Reader read data values for all cells, irrespective of value.
5140 * Set to false to advise the Reader to ignore cells containing a null value or an empty string.
52- *
53- * @param bool $readEmptyCells
54- *
55- * @return IReader
5641 */
57- public function setReadEmptyCells ($ readEmptyCells );
42+ public function setReadEmptyCells (bool $ readEmptyCells ): self ;
5843
5944 /**
6045 * Read charts in workbook?
6146 * If this is true, then the Reader will include any charts that exist in the workbook.
6247 * Note that a ReadDataOnly value of false overrides, and charts won't be read regardless of the IncludeCharts value.
6348 * If false (the default) it will ignore any charts defined in the workbook file.
64- *
65- * @return bool
6649 */
67- public function getIncludeCharts ();
50+ public function getIncludeCharts (): bool ;
6851
6952 /**
7053 * Set read charts in workbook
7154 * Set to true, to advise the Reader to include any charts that exist in the workbook.
7255 * Note that a ReadDataOnly value of false overrides, and charts won't be read regardless of the IncludeCharts value.
7356 * Set to false (the default) to discard charts.
74- *
75- * @param bool $includeCharts
76- *
77- * @return IReader
7857 */
79- public function setIncludeCharts ($ includeCharts );
58+ public function setIncludeCharts (bool $ includeCharts ): self ;
8059
8160 /**
8261 * Get which sheets to load
8362 * Returns either an array of worksheet names (the list of worksheets that should be loaded), or a null
8463 * indicating that all worksheets in the workbook should be loaded.
8564 *
86- * @return mixed
65+ * @return ?string[]
8766 */
8867 public function getLoadSheetsOnly ();
8968
9069 /**
9170 * Set which sheets to load.
9271 *
93- * @param mixed $value
72+ * @param null|string|string[] $sheetList
9473 * This should be either an array of worksheet names to be loaded, or a string containing a single worksheet name.
9574 * If NULL, then it tells the Reader to read all worksheets in the workbook
96- *
97- * @return IReader
9875 */
99- public function setLoadSheetsOnly ($ value ) ;
76+ public function setLoadSheetsOnly ($ sheetList ): self ;
10077
10178 /**
10279 * Set all sheets to load
10380 * Tells the Reader to load all worksheets from the workbook.
104- *
105- * @return IReader
10681 */
107- public function setLoadAllSheets ();
82+ public function setLoadAllSheets (): self ;
10883
10984 /**
11085 * Read filter.
111- *
112- * @return IReadFilter
11386 */
114- public function getReadFilter ();
87+ public function getReadFilter (): IReadFilter ;
11588
11689 /**
11790 * Set read filter.
118- *
119- * @return IReader
12091 */
121- public function setReadFilter (IReadFilter $ readFilter );
92+ public function setReadFilter (IReadFilter $ readFilter ): self ;
12293
12394 /**
12495 * Loads PhpSpreadsheet from file.
125- *
126- * @return \PhpOffice\PhpSpreadsheet\Spreadsheet
12796 */
128- public function load (string $ filename , int $ flags = 0 );
97+ public function load (string $ filename , int $ flags = 0 ): Spreadsheet ;
12998}
0 commit comments