Fix phpcs warning re: func_get_args()

Created on 23 June 2023, over 1 year ago

Problem/Motivation

phpcs testing for PHP 8 shows the following warning for `src/Form/BlockSettingsForm.php`:

`Since PHP 7.0, functions inspecting arguments, like func_get_args(), no longer report the original value as passed to a parameter, but will instead provide the current value. The parameter "$array" was used, and possibly changed (by reference), on line 155.`

Steps to reproduce

Run e.g. `./vendor/bin/phpcs -p web/modules/contrib/gutenberg --extensions=php,module,theme,install,profile --standard=vendor/phpcompatibility/php-compatibility/PHPCompatibility --runtime-set testVersion 8.1`

Proposed resolution

Attached patch moves the func_get_args() call first in the arrayFlatten() method.

📌 Task
Status

Needs review

Version

2.0

Component

Code

Created by

🇨🇦Canada bgilhome Victoria

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

Comments & Activities

Production build 0.71.5 2024