Needs review
Project:
Drupal core
Version:
main
Component:
base system
Priority:
Minor
Category:
Task
Assigned:
Unassigned
Reporter:
Created:
22 Oct 2026 at 21:49 UTC
Updated:
22 Oct 2026 at 22:49 UTC
Jump to comment: Most recent
Six interface checks in four classes use class_implements() followed by in_array(). These checks create an interface list to answer a boolean question.
is_subclass_of(), which has supported interface checks since PHP 5.3.7, in ContextDefinition, BatchBuilder, and CKEditor5PluginDefinition.is_subclass_of()'s error behaviour differs as it returns FALSE for unknown classes.EntityType::entityClassImplements() method in EntityDataDefinition.Main benefits are clearer interface checks and, for invalid ContextDefinition classes, a meaningful validation exception instead of a PHP warning followed by an unrelated in_array() TypeError.
Isolated benchmarks also show small performance improvements.
Review.
None.
None.
None.
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #3
panchoReady for review.