Problem/Motivation

Drupal.Functions.MultiLineFunctionDeclaration generates broken code.

Steps to reproduce

1. Create a code file a.php:

<?php

function a(
): void {
}

2. Run the phpcbf:

phpcbf --standard=Drupal --sniffs=Drupal.Functions.MultiLineFunctionDeclaration ./a.php

3. Observe the resulting file:

<?php

function a(
  ,
): void {
}

Proposed resolution

Don't add comma(s) if a function contains no arguments.

Comments

ragnarkurm created an issue.