Problem/Motivation

Use new PHP 8 function str_contains instead. More readable, less instructions, and more efficient.

Steps to reproduce

Proposed resolution

Some examples,

In lib/Drupal/Core/Entity/Plugin/EntityReferenceSelection/PhpSelection.php:122:        
- return strpos($label, $match) !== FALSE;
+ return str_contains($label, $match);
In lib/Drupal/Core/Routing/RouteCompiler.php:101:
-      if (strpos($part, '{') === FALSE) {
+      if (!str_contains($part, '{')) {

Remaining tasks

User interface changes

API changes

Data model changes

Release notes snippet

Comments

Chris64 created an issue. See original summary.

cilefen’s picture

Version: 10.1.x-dev » 11.x-dev
Status: Needs work » Active
cilefen’s picture

cilefen’s picture

Status: Active » Closed (duplicate)

The original issue has a plan and a merge request.

chris64’s picture

OK.