@@ -77,11 +77,11 @@ public function __construct()
7777 /**
7878 * Can the current IReader read the file?
7979 */
80- public function canRead (string $ filename ): bool
80+ public function canRead ($ file ): bool
8181 {
8282 $ data = null ;
83- if (File::testFileNoThrow ($ filename )) {
84- $ data = $ this ->gzfileGetContents ($ filename );
83+ if (File::testFileNoThrow ($ file )) {
84+ $ data = $ this ->gzfileGetContents ($ file );
8585 if (!str_contains ($ data , self ::NAMESPACE_GNM )) {
8686 $ data = '' ;
8787 }
@@ -100,15 +100,15 @@ private static function matchXml(XMLReader $xml, string $expectedLocalName): boo
100100 /**
101101 * Reads names of the worksheets from a file, without parsing the whole file to a Spreadsheet object.
102102 */
103- public function listWorksheetNames (string $ filename ): array
103+ public function listWorksheetNames ($ file ): array
104104 {
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. ' );
108108 }
109109
110110 $ xml = new XMLReader ();
111- $ contents = $ this ->gzfileGetContents ($ filename );
111+ $ contents = $ this ->gzfileGetContents ($ file );
112112 $ xml ->xml ($ contents , null , Settings::getLibXmlLoaderOptions ());
113113 $ xml ->setParserProperty (2 , true );
114114
@@ -129,15 +129,15 @@ public function listWorksheetNames(string $filename): array
129129 /**
130130 * Return worksheet info (Name, Last Column Letter, Last Column Index, Total Rows, Total Columns).
131131 */
132- public function listWorksheetInfo (string $ filename ): array
132+ public function listWorksheetInfo ($ file ): array
133133 {
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. ' );
137137 }
138138
139139 $ xml = new XMLReader ();
140- $ contents = $ this ->gzfileGetContents ($ filename );
140+ $ contents = $ this ->gzfileGetContents ($ file );
141141 $ xml ->xml ($ contents , null , Settings::getLibXmlLoaderOptions ());
142142 $ xml ->setParserProperty (2 , true );
143143
@@ -230,14 +230,14 @@ private static function testSimpleXml(mixed $value): SimpleXMLElement
230230 /**
231231 * Loads Spreadsheet from file.
232232 */
233- protected function loadSpreadsheetFromFile (string $ filename ): Spreadsheet
233+ protected function loadSpreadsheetFromFile ($ file ): Spreadsheet
234234 {
235235 // Create new Spreadsheet
236236 $ spreadsheet = new Spreadsheet ();
237237 $ spreadsheet ->removeSheetByIndex (0 );
238238
239239 // Load into this instance
240- return $ this ->loadIntoExisting ($ filename , $ spreadsheet );
240+ return $ this ->loadIntoExisting ($ file , $ spreadsheet );
241241 }
242242
243243 /**
0 commit comments