\Drupal\Core\Queue\QueueInterface::createItem is typehinted as possibly returning bool, but never returns true

Created on 1 October 2023, about 1 year ago
Updated 17 October 2023, about 1 year ago

Problem/Motivation

\Drupal\Core\Queue\QueueInterface::createItem is incorrectly typed and causes static analysis tools like PHPStan to trip up.

Steps to reproduce

Run PHPStan on max where code calls \Drupal\Core\Queue\QueueInterface::createItem. PHPStan will assume the returned variable is either string or int or bool. Where in fact there is never TRUE.

Proposed resolution

Change typehint from bool|int|string to false|int|string.

Remaining tasks

Implement

🐛 Bug report
Status

Fixed

Version

11.0 🔥

Component
Documentation 

Last updated about 1 hour ago

No maintainer
Created by

🇦🇺Australia dpi Perth, Australia

Live updates comments and jobs are added and updated live.
  • Novice

    It would make a good project for someone who is new to the Drupal contribution process. It's preferred over Newbie.

Sign in to follow issues

Comments & Activities

Production build 0.71.5 2024