Problem/Motivation

Per @longwave in #3324560: Replace strpos/substr with str_starts_with() / str_contains() / str_ends_with():

The out of scope change is due to PHPStorm automatically changing list() to [].

We fixed it once across core in #3222769: [November 8, 2021] Replace all list (array destructuring) assignment to the array syntax

Then it was accidentally reverted again in #3181778: [w/c September 17th] Replace t() with $this->t() in all plugins

[ayrton:drupal | Sun 19:26:03] $ grep -rE "\blist\(" * | grep -v "vendor" | grep -v "node_modules"
core/modules/link/src/Plugin/Field/FieldWidget/LinkWidget.php:      list($entity_type, $entity_id) = explode('/', substr($uri, 7), 2);

Proposed resolution

Fix it in its own patch.

CommentFileSizeAuthor
scope_plz.patch811 bytesxjm

Comments

xjm created an issue. See original summary.

xjm credited longwave.

xjm’s picture

longwave’s picture

Status: Needs review » Reviewed & tested by the community

Confirmed this is the only instance in core with a slightly different method:

$ rg '\Wlist\('
core/modules/link/src/Plugin/Field/FieldWidget/LinkWidget.php
75:      list($entity_type, $entity_id) = explode('/', substr($uri, 7), 2);

  • catch committed a8697824 on 10.0.x
    Issue #3327950 by xjm, longwave: Remove last remaining list() from core...

  • catch committed 8a90cc9d on 10.1.x
    Issue #3327950 by xjm, longwave: Remove last remaining list() from core
    

  • catch committed 5b0d2b46 on 9.5.x
    Issue #3327950 by xjm, longwave: Remove last remaining list() from core...
catch’s picture

Status: Reviewed & tested by the community » Fixed

Committed/pushed to 10.1.x, 10.0.x and 9.5.x, thanks!

catch’s picture

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.