@@ -304,7 +304,9 @@ public function formatList($list)
304
304
if (($ this ->options ['parts_newline ' ])
305
305
&& (!$ formattedOptions )
306
306
&& (empty (self ::$ INLINE_CLAUSES [$ lastClause ]))
307
- && ($ curr ->type != Token::TYPE_KEYWORD )
307
+ && (($ curr ->type !== Token::TYPE_KEYWORD )
308
+ || (($ curr ->type === Token::TYPE_KEYWORD )
309
+ && ($ curr ->flags & Token::FLAG_KEYWORD_FUNCTION )))
308
310
) {
309
311
$ formattedOptions = true ;
310
312
$ lineEnded = true ;
@@ -334,8 +336,8 @@ public function formatList($list)
334
336
// Formatting fragments delimited by comma.
335
337
if (($ prev ->type === Token::TYPE_OPERATOR ) && ($ prev ->value === ', ' )) {
336
338
// Fragments delimited by a comma are broken into multiple
337
- // pieces only if the clause if the clause is not inlined or
338
- // this fragment is between brackets that were on new line.
339
+ // pieces only if the clause is not inlined or this fragment
340
+ // is between brackets that are on new line.
339
341
if (((empty (self ::$ INLINE_CLAUSES [$ lastClause ]))
340
342
&& ($ this ->options ['parts_newline ' ]))
341
343
|| (end ($ blocksLineEndings ) === true )
@@ -401,8 +403,7 @@ public function formatList($list)
401
403
$ comment = '' ;
402
404
}
403
405
404
- // Saving the next token as the one that will be processed during
405
- // the next iteration.
406
+ // Iteration finished, consider current token as previous.
406
407
$ prev = $ curr ;
407
408
}
408
409
0 commit comments