2
2
3
3
namespace PhpOffice \PhpSpreadsheet \Reader ;
4
4
5
+ use PhpOffice \PhpSpreadsheet \Spreadsheet ;
6
+
5
7
interface IReader
6
8
{
7
9
public const LOAD_WITH_CHARTS = 1 ;
8
10
9
- /**
10
- * IReader constructor.
11
- */
12
- public function __construct ();
13
-
14
11
/**
15
12
* Can the current IReader read the file?
16
13
*/
@@ -20,110 +17,82 @@ public function canRead(string $filename): bool;
20
17
* Read data only?
21
18
* If this is true, then the Reader will only read data values for cells, it will not read any formatting information.
22
19
* If false (the default) it will read data and formatting.
23
- *
24
- * @return bool
25
20
*/
26
- public function getReadDataOnly ();
21
+ public function getReadDataOnly (): bool ;
27
22
28
23
/**
29
24
* Set read data only
30
25
* Set to true, to advise the Reader only to read data values for cells, and to ignore any formatting information.
31
26
* 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
36
27
*/
37
- public function setReadDataOnly ($ readDataOnly );
28
+ public function setReadDataOnly (bool $ readDataOnly ): self ;
38
29
39
30
/**
40
31
* Read empty cells?
41
32
* If this is true (the default), then the Reader will read data values for all cells, irrespective of value.
42
33
* If false it will not read data for cells containing a null value or an empty string.
43
- *
44
- * @return bool
45
34
*/
46
- public function getReadEmptyCells ();
35
+ public function getReadEmptyCells (): bool ;
47
36
48
37
/**
49
38
* Set read empty cells
50
39
* Set to true (the default) to advise the Reader read data values for all cells, irrespective of value.
51
40
* 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
56
41
*/
57
- public function setReadEmptyCells ($ readEmptyCells );
42
+ public function setReadEmptyCells (bool $ readEmptyCells ): self ;
58
43
59
44
/**
60
45
* Read charts in workbook?
61
46
* If this is true, then the Reader will include any charts that exist in the workbook.
62
47
* Note that a ReadDataOnly value of false overrides, and charts won't be read regardless of the IncludeCharts value.
63
48
* If false (the default) it will ignore any charts defined in the workbook file.
64
- *
65
- * @return bool
66
49
*/
67
- public function getIncludeCharts ();
50
+ public function getIncludeCharts (): bool ;
68
51
69
52
/**
70
53
* Set read charts in workbook
71
54
* Set to true, to advise the Reader to include any charts that exist in the workbook.
72
55
* Note that a ReadDataOnly value of false overrides, and charts won't be read regardless of the IncludeCharts value.
73
56
* Set to false (the default) to discard charts.
74
- *
75
- * @param bool $includeCharts
76
- *
77
- * @return IReader
78
57
*/
79
- public function setIncludeCharts ($ includeCharts );
58
+ public function setIncludeCharts (bool $ includeCharts ): self ;
80
59
81
60
/**
82
61
* Get which sheets to load
83
62
* Returns either an array of worksheet names (the list of worksheets that should be loaded), or a null
84
63
* indicating that all worksheets in the workbook should be loaded.
85
64
*
86
- * @return mixed
65
+ * @return ?string[]
87
66
*/
88
67
public function getLoadSheetsOnly ();
89
68
90
69
/**
91
70
* Set which sheets to load.
92
71
*
93
- * @param mixed $value
72
+ * @param null|string|string[] $sheetList
94
73
* This should be either an array of worksheet names to be loaded, or a string containing a single worksheet name.
95
74
* If NULL, then it tells the Reader to read all worksheets in the workbook
96
- *
97
- * @return IReader
98
75
*/
99
- public function setLoadSheetsOnly ($ value ) ;
76
+ public function setLoadSheetsOnly ($ sheetList ): self ;
100
77
101
78
/**
102
79
* Set all sheets to load
103
80
* Tells the Reader to load all worksheets from the workbook.
104
- *
105
- * @return IReader
106
81
*/
107
- public function setLoadAllSheets ();
82
+ public function setLoadAllSheets (): self ;
108
83
109
84
/**
110
85
* Read filter.
111
- *
112
- * @return IReadFilter
113
86
*/
114
- public function getReadFilter ();
87
+ public function getReadFilter (): IReadFilter ;
115
88
116
89
/**
117
90
* Set read filter.
118
- *
119
- * @return IReader
120
91
*/
121
- public function setReadFilter (IReadFilter $ readFilter );
92
+ public function setReadFilter (IReadFilter $ readFilter ): self ;
122
93
123
94
/**
124
95
* Loads PhpSpreadsheet from file.
125
- *
126
- * @return \PhpOffice\PhpSpreadsheet\Spreadsheet
127
96
*/
128
- public function load (string $ filename , int $ flags = 0 );
97
+ public function load (string $ filename , int $ flags = 0 ): Spreadsheet ;
129
98
}
0 commit comments