@@ -51,7 +51,7 @@ public function setEmptyTableMessage(string $emptyTableMessage): void
5151 $ this ->emptyTableMessage = $ emptyTableMessage ;
5252 }
5353
54- public static function getColumnStringFromIndex (int $ index )
54+ public static function getColumnStringFromIndex (int $ index ): string
5555 {
5656 if ($ index < 0 ) {
5757 throw new Excel \Exception \InvalidArgumentException ('Column index must be equal or greater than zero ' );
@@ -173,7 +173,7 @@ private function writeColumnsHeading(Table $table, array $row): void
173173 $ table ->flagDataRowStart ();
174174 }
175175
176- private function writeRow (Table $ table , array $ row , string $ type = null ): void
176+ private function writeRow (Table $ table , array $ row , ? string $ type = null ): void
177177 {
178178 $ table ->resetColumn ();
179179 $ sheet = $ table ->getActiveSheet ();
@@ -212,6 +212,9 @@ private function writeRow(Table $table, array $row, string $type = null): void
212212 $ table ->incrementRow ();
213213 }
214214
215+ /**
216+ * @param mixed $value
217+ */
215218 private function sanitize ($ value ): string
216219 {
217220 static $ sanitizeMap = [
@@ -225,14 +228,14 @@ private function sanitize($value): string
225228 $ value = \str_replace (
226229 \array_keys ($ sanitizeMap ),
227230 \array_values ($ sanitizeMap ),
228- $ value
231+ ( string ) $ value
229232 );
230233 $ value = \mb_convert_encoding ($ value , 'Windows-1252 ' );
231234
232235 return $ value ;
233236 }
234237
235- private function generateFormats (Table $ table , array $ titles , ColumnCollectionInterface $ columnCollection = null ): void
238+ private function generateFormats (Table $ table , array $ titles , ? ColumnCollectionInterface $ columnCollection = null ): void
236239 {
237240 $ this ->formats = [];
238241 foreach ($ titles as $ key ) {
0 commit comments