Problem/Motivation

PHP 7.4 syntax issues causing warning messages.

Steps to reproduce

phpcs --standard=PHPCompatibility --runtime-set testVersion 7.4

Proposed resolution

Use PHP 7.4 compatible syntax where possible without breaking backwards compatibility.

Remaining tasks

None.

User interface changes

None.

API changes

None.

Data model changes

None.

CommentFileSizeAuthor
#2 3203849-php-7.4-compatibility.patch1.71 KBmvc
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

mvc created an issue. See original summary.

mvc’s picture

Status: Active » Needs review
FileSize
1.71 KB

The curly brace array syntax causes noisy messages in error logs; the other two issues are false reports and are fixed here so that anyone running a PHP 7.4 compatibility check won't see a message and have to take time to investigate.

alexpott’s picture

@mvc I'd remove the two other changes - they're not necessary for the fix. We can add automated testing to check for PHP 7.4 compatibility.

Gábor Hojtsy’s picture

Given that this is in "vendor" libraries (that we inline for the sake of ease of use), can we see about updating them instead? I assume they worked this out :) This would not apply to the Drupal 8/9 version since those should have the vendor libraries available from core.

mvc’s picture

@Gábor Hojtsy yes, those issues were fixed upstream, but the copies here are ancient and updating them would be a huge change, which would have required a lot more time & test coverage.

I can re-roll to just include the curly brace issue if you want but then the code will still look wrong to anyone running a PHP compatibility check, in an automated test or otherwise.