Skip to content

Commit de2054d

Browse files
authored
Merge pull request #745 from murtukov/fix/last-comma-generation-issue
Fix generation of last comma in arrays
2 parents cab464d + f9be469 commit de2054d

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/Generator/TypeGenerator.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -626,7 +626,8 @@ protected function stringifyNormalArray($array, $offset = 1): string
626626
.$this->stringifyValue($value, $offset)
627627
;
628628

629-
if ($value !== \end($array)) {
629+
\end($array);
630+
if ($key !== \key($array)) {
630631
$code .= ', ';
631632
}
632633
}

0 commit comments

Comments
 (0)