@@ -77,11 +77,11 @@ public function __construct()
77
77
/**
78
78
* Can the current IReader read the file?
79
79
*/
80
- public function canRead (string $ filename ): bool
80
+ public function canRead ($ file ): bool
81
81
{
82
82
$ data = null ;
83
- if (File::testFileNoThrow ($ filename )) {
84
- $ data = $ this ->gzfileGetContents ($ filename );
83
+ if (File::testFileNoThrow ($ file )) {
84
+ $ data = $ this ->gzfileGetContents ($ file );
85
85
if (!str_contains ($ data , self ::NAMESPACE_GNM )) {
86
86
$ data = '' ;
87
87
}
@@ -100,15 +100,15 @@ private static function matchXml(XMLReader $xml, string $expectedLocalName): boo
100
100
/**
101
101
* Reads names of the worksheets from a file, without parsing the whole file to a Spreadsheet object.
102
102
*/
103
- public function listWorksheetNames (string $ filename ): array
103
+ public function listWorksheetNames ($ file ): array
104
104
{
105
- File::assertFile ($ filename );
106
- if (!$ this ->canRead ($ filename )) {
107
- throw new Exception ($ filename . ' is an invalid Gnumeric file. ' );
105
+ File::assertFile ($ file );
106
+ if (!$ this ->canRead ($ file )) {
107
+ throw new Exception ($ file . ' is an invalid Gnumeric file. ' );
108
108
}
109
109
110
110
$ xml = new XMLReader ();
111
- $ contents = $ this ->gzfileGetContents ($ filename );
111
+ $ contents = $ this ->gzfileGetContents ($ file );
112
112
$ xml ->xml ($ contents , null , Settings::getLibXmlLoaderOptions ());
113
113
$ xml ->setParserProperty (2 , true );
114
114
@@ -129,15 +129,15 @@ public function listWorksheetNames(string $filename): array
129
129
/**
130
130
* Return worksheet info (Name, Last Column Letter, Last Column Index, Total Rows, Total Columns).
131
131
*/
132
- public function listWorksheetInfo (string $ filename ): array
132
+ public function listWorksheetInfo ($ file ): array
133
133
{
134
- File::assertFile ($ filename );
135
- if (!$ this ->canRead ($ filename )) {
136
- throw new Exception ($ filename . ' is an invalid Gnumeric file. ' );
134
+ File::assertFile ($ file );
135
+ if (!$ this ->canRead ($ file )) {
136
+ throw new Exception ($ file . ' is an invalid Gnumeric file. ' );
137
137
}
138
138
139
139
$ xml = new XMLReader ();
140
- $ contents = $ this ->gzfileGetContents ($ filename );
140
+ $ contents = $ this ->gzfileGetContents ($ file );
141
141
$ xml ->xml ($ contents , null , Settings::getLibXmlLoaderOptions ());
142
142
$ xml ->setParserProperty (2 , true );
143
143
@@ -230,14 +230,14 @@ private static function testSimpleXml(mixed $value): SimpleXMLElement
230
230
/**
231
231
* Loads Spreadsheet from file.
232
232
*/
233
- protected function loadSpreadsheetFromFile (string $ filename ): Spreadsheet
233
+ protected function loadSpreadsheetFromFile ($ file ): Spreadsheet
234
234
{
235
235
// Create new Spreadsheet
236
236
$ spreadsheet = new Spreadsheet ();
237
237
$ spreadsheet ->removeSheetByIndex (0 );
238
238
239
239
// Load into this instance
240
- return $ this ->loadIntoExisting ($ filename , $ spreadsheet );
240
+ return $ this ->loadIntoExisting ($ file , $ spreadsheet );
241
241
}
242
242
243
243
/**
0 commit comments