RevisionLogInterface is typehinted as always returning entity/ids, but cannot guarantee set/existing values

Created on 12 September 2022, almost 2 years ago
Updated 3 February 2023, over 1 year ago

Problem/Motivation

\Drupal\Core\Entity\RevisionLogInterface 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\Entity\EntityTypeInterface::getRevisionUser/getRevisionUserId/getRevisionLogMessage. PHPStan will assume the returned variable is non empty. However returned values may not actually be set.

Proposed resolution

Change typehint, adding null values.

Remaining tasks

Implement

πŸ› Bug report
Status

Fixed

Version

10.1 ✨

Component
DocumentationΒ  β†’

Last updated 1 day 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

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.69.0 2024