While running a PHP version test against local codebase for PHP 7.2 compatibility, I received the following warning coming from fieldable_panels_pane.class.php version 7.x-1.10.
FILE: ../docroot/sites/all/modules/contrib/fieldable_panels_panes/plugins/export_ui/fieldable_panels_pane.class.php
------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
------------------------------------------------
138 | WARNING | 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 "$item" was used, and possibly changed (by reference), on line 125.
| Comment | File | Size | Author |
|---|---|---|---|
| #7 | fieldable_panels_panes-php72-3087902-5_fixed.PNG | 58.11 KB | ruyakhokhar |
| #5 | fieldable_panels_panes-php72-3087902-5.patch | 835 bytes | cboyden |
Comments
Comment #2
wstocker commentedComment #3
wstocker commentedComment #4
damienmckennaThanks for reporting that, Wendy.
Comment #5
cboyden commentedThe approach I've seen some other modules take to fix this is to call
func_get_args()as early as possible and assign the result to a variable, then use that variable later on. Here's a patch; after this change I'm no longer getting the warning fromphpcs.Comment #6
ruyakhokhar commentedComment #7
ruyakhokhar commentedHi all, Patch #5 works fine for me. Screenshot attached for the same.
Comment #8
ruyakhokhar commentedComment #9
damienmckennaComment #10
chaseonthewebComment #12
damienmckennaCommitted. Thank you.