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

Comments

mvc created an issue. See original summary.

mvc’s picture

Status: Active » Needs review
StatusFileSize
new1.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.

heddn’s picture

Status: Needs review » Closed (outdated)

7.x branch of this code is not actively supported. If this is still an issue in a more modern version of drupal, feel free to re-open.

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.