@@ -89,11 +89,11 @@ private function iterateRows(object $exportable, $rows): void
8989 {
9090 $ formats = $ exportable instanceof WithColumnFormatting ? $ exportable ->columnFormats () : [];
9191 $ withMapping = $ exportable instanceof WithMapping;
92- $ row_index = 1 ;
92+ $ rowIndex = 1 ;
9393 foreach ($ rows as $ row ) {
9494 $ mappedRow = $ withMapping ? $ exportable ->map ($ row ) : $ row ;
9595 $ normalizedRow = $ this ->normalizeRow ($ mappedRow );
96- $ formattedRow = $ this ->applyFormatting ($ normalizedRow , $ formats , $ row_index ++);
96+ $ formattedRow = $ this ->applyFormatting ($ normalizedRow , $ formats , $ rowIndex ++);
9797 $ this ->writeRow ($ formattedRow );
9898 }
9999 }
@@ -115,10 +115,10 @@ private function normalizeRow($row): array
115115 /**
116116 * @throws InvalidCellValueException
117117 */
118- private function applyFormatting (array $ row , array $ formats , int $ row_index ): array
118+ private function applyFormatting (array $ row , array $ formats , int $ rowIndex ): array
119119 {
120120 return array_map (
121- fn ($ value , int $ column_index ) => $ this ->formatCellValue ($ value , $ formats , $ row_index , $ column_index ),
121+ fn ($ value , int $ columnIndex ) => $ this ->formatCellValue ($ value , $ formats , $ rowIndex , $ columnIndex ),
122122 $ row ,
123123 array_keys ($ row )
124124 );
@@ -127,9 +127,9 @@ private function applyFormatting(array $row, array $formats, int $row_index): ar
127127 /**
128128 * @throws InvalidCellValueException
129129 */
130- private function formatCellValue ($ value , array $ formats , int $ row_index , int $ column_index ): string
130+ private function formatCellValue ($ value , array $ formats , int $ rowIndex , int $ columnIndex ): string
131131 {
132- $ columnLetter = CsvHelper::getColumnLetter ($ column_index + 1 );
132+ $ columnLetter = CsvHelper::getColumnLetter ($ columnIndex + 1 );
133133 $ format = $ formats [$ columnLetter ] ?? null ;
134134
135135 if ($ format === CellFormat::DATE ) {
@@ -153,7 +153,7 @@ private function formatCellValue($value, array $formats, int $row_index, int $co
153153 return (string )$ value ;
154154 }
155155 } catch (Throwable $ e ) {
156- throw new InvalidCellValueException ("{$ columnLetter }{$ row_index }" );
156+ throw new InvalidCellValueException ("{$ columnLetter }{$ rowIndex }" );
157157 }
158158
159159 return $ value ;
0 commit comments