\Drupal\Core\Config\StorageInterface::read is typehinted as possibly returning bool, but never returns true

Created on 3 October 2023, about 1 year ago
Updated 25 November 2023, about 1 year ago

Problem/Motivation

\Drupal\Core\Config\StorageInterface::read 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\Config\StorageInterface::read. PHPStan will assume the returned variable is either array or bool. Where in fact there is never TRUE.

Proposed resolution

Change typehint from array|bool to array|false.

Remaining tasks

Implement

🐛 Bug report
Status

Fixed

Version

10.1

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