Validate trailing comma in multi-line function declaration

Created on 13 April 2024, 8 months ago
Updated 4 June 2024, 7 months 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.71.5 2024