Skip to content

Commit

Permalink
Merge pull request #745 from murtukov/fix/last-comma-generation-issue
Browse files Browse the repository at this point in the history
Fix generation of last comma in arrays
  • Loading branch information
murtukov authored Aug 17, 2020
2 parents cab464d + f9be469 commit de2054d
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/Generator/TypeGenerator.php
Original file line number Diff line number Diff line change
Expand Up @@ -626,7 +626,8 @@ protected function stringifyNormalArray($array, $offset = 1): string
.$this->stringifyValue($value, $offset)
;

if ($value !== \end($array)) {
\end($array);
if ($key !== \key($array)) {
$code .= ', ';
}
}
Expand Down

0 comments on commit de2054d

Please sign in to comment.