The PHPCompatibility sniffer for PHPCS flags several issues related to "using call-time pass-by-reference"

$ phpcs --standard=PHPCompatibility --runtime-set testVersion 7.1 contrib/devel

===========================
CONTRIB (warnings excluded)
===========================
FILE: .../contrib/devel/webprofiler/src/Views/TraceableViewExecutable.php
----------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
----------------------------------------------------------------------
138 | ERROR | Using a call-time pass-by-reference is deprecated
| | since PHP 5.3 and prohibited since PHP 5.4
----------------------------------------------------------------------

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

click2tman created an issue. See original summary.

click2tman’s picture

Version: 8.x-1.x-dev » 8.x-1.0-rc2
Issue summary: View changes
DamienMcKenna’s picture

Version: 8.x-1.0-rc2 » 8.x-1.x-dev
Status: Active » Needs review
FileSize
560 bytes

This is the code, but does it still work?

moshe weitzman’s picture

Anyone available to test this?

lussoluca’s picture

Status: Needs review » Closed (works as designed)

I know that PHPCS is not happy with this, but the code for this method is copied from the Drupal\views\ViewExecutable.php from Core, with some minor modification.
I prefer not to change it to remain aligned with the Core version. Maybe we can open an issue on the Views issue queue (if it doesn't already exists)?

DamienMcKenna’s picture

Good catch, that file in Views still includes this line:

    // Let modules modify the view output after it is rendered.
    $module_handler->invokeAll('views_post_render', [$this, &$this->display_handler->output, $cache]);
Liam Morland’s picture

Issue tags: -PHPCompatibility