Validate trailing comma in multi-line function declaration

Created on 13 April 2024, 2 months ago
Updated 4 June 2024, 22 days ago

Problem/Motivation

There is a coding standard now to require trailing commas on multi-line function declarations in #3295249: Allow multi-line function declarations β†’ .

Steps to reproduce

This should throw an error on PHP higher than 8.0 because comma missing

/**
 * Last parameter should have a trailing comma.
 */
function test29(
  int $a,
  string $b
) {
  echo "Hello";
}

Proposed resolution

Check if we can find any existing sniff upstream and use that. Otherwise contribute improvement or write sniff in Coder.

Remaining tasks

✨ Feature request
Status

Fixed

Version

8.3

Component

Coder Sniffer

Created by

πŸ‡¦πŸ‡ΉAustria klausi πŸ‡¦πŸ‡Ή Vienna

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Production build 0.69.0 2024