Once #2368807: Remove special support for NULL values in FieldItemList is in, there is no runtime case where ItemList::$list can ever *not* be set.
A lot of if (isset($this->list)) checks in ItemList / FieldItemList can be removed.

Beta phase evaluation

Reference: https://www.drupal.org/core/beta-changes
Issue category Dead code removal and followup of critical
Issue priority Normal: because, well, not major :-)
Disruption None, just better understandability and maintainability
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

yched’s picture

yched’s picture

yched’s picture

Status: Active » Needs review
FileSize
7.14 KB

Patch.

yched’s picture

While we're in there, the doc for the $list class member could be updated for our current practices.

The last submitted patch, 3: 2392805-ItemList_cleanup_isset-3.patch, failed testing.

Status: Needs review » Needs work

The last submitted patch, 4: 2392805-ItemList_cleanup_isset-4.patch, failed testing.

yched’s picture

Status: Needs work » Needs review

Green at last :-)

yched’s picture

yched’s picture

Issue summary: View changes

Added Beta phase evaluation

amateescu’s picture

Status: Needs review » Reviewed & tested by the community

Looks great to me. I've seen in other issues that "dead code" is considered a bug, but I will let core committers make that decision if it's true.

alexpott’s picture

Category: Task » Bug report
Issue summary: View changes
Status: Reviewed & tested by the community » Fixed

Removing dead code is fixing a bug - we have less complexity too and this is a followup of a critical.

Committed 4f1de4e and pushed to 8.0.x. Thanks!

  • alexpott committed 4f1de4e on 8.0.x
    Issue #2392805 by yched: Remove useless isset() checks in ItemList /...

Status: Fixed » Closed (fixed)

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