Errors when source code passes by reference during analysis

Created on 28 April 2023, over 1 year ago

Problem/Motivation

When analyzing a Drupal 7 module that passes variables by reference, this module throws errors like:

In Parser.php line 1472:

Error at line 273:16 in file /var/www/html/web/modules/custom/partial_date/ includes/partial_date.views.year_period_handler.inc: excepted expression operand but got T_AMPERSAND_FOLLOWED_BY_VAR_OR_VARARG

Failed to run drush dmu-analyze partial_date: exit status 1

Steps to reproduce

Download the partial_date module and run drush dmu-analyze partial_date. Observe that if you remove the ampersand on any specific point where an error is thrown, an additional error will be thrown wherever else an ampersand is used to pass a variable by reference. Not certain if this issue is specifically when running PHP 8.0+, I was testing using 8.1.

Proposed resolution

Update the code (the underlying pharborist library, likely) to handle variables being passed by reference without error.

🐛 Bug report
Status

Active

Version

1.0

Component

Code

Created by

🇨🇦Canada mandclu

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

Comments & Activities

Production build 0.71.5 2024