Quantcast
Channel: Issues for Drupal core
Viewing all articles
Browse latest Browse all 293850

EntityTypeInterface::getKey() is typehinted as possibly returning bool, but never returns true

$
0
0

Problem/Motivation

\Drupal\Core\Entity\EntityTypeInterface::getKey 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::getKey. PHPStan will assume the returned variable is either string or bool. Where in fact there is never TRUE.

Proposed resolution

Change typehint from string|bool to string|false.

Remaining tasks

Implement


Viewing all articles
Browse latest Browse all 293850

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>