Drupal.Functions.MultiLineFunctionDeclaration breaks closures

Created on 4 August 2024, 5 months ago

Problem/Motivation

Drupal.Functions.MultiLineFunctionDeclaration breaks closure code.

Steps to reproduce

1. Create test file b.php:

<?php

$array = array_map(function ($nr) {return (int) $nr;}, $array);

2. Run phpcbf:

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

3. Observe the resulting file:

<?php

$array = array_map(function ($nr) {
return (int) $nr;}, $array);

Proposed resolution

The Drupal.Functions.MultiLineFunctionDeclaration should not break closures.

🐛 Bug report
Status

Active

Version

8.3

Component

Coder Sniffer

Created by

🇪🇪Estonia ragnarkurm

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

Comments & Activities

Production build 0.71.5 2024