AliasStorageHelperInterface::loadBySource() annotated return type wrong (false vs null)

Created on 25 September 2022, over 2 years ago
Updated 31 July 2024, 9 months ago

Problem/Motivation

AliasStorageHelperInterface::loadBySource() has annotated return type "@return bool|array".
AliasStorageHelper::loadBySource() has actual return type null|array.

One of them is wrong.

I prefer NULL.

Steps to reproduce

Proposed resolution

Change the doc comment to "array|null".
OR
Change it to "array|null|false" because 3rd party / custom implementations might already be returning false.

Side quest:
Explicit return NULL in AliasStorageHelper, instead of the implicit void = null.

Remaining tasks

User interface changes

API changes

Other implementations are now encouraged to also return NULL.
Calling code should check for NULL instead of FALSE.
OR
Calling code should check anything empty-ish because older implementations might still return FALSE.

Data model changes

📌 Task
Status

Needs work

Version

1.0

Component

Code

Created by

🇩🇪Germany donquixote

Live updates comments and jobs are added and updated live.
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.

  • 🇨🇭Switzerland berdir Switzerland

    Needs to be a merge request now.

    I think the chances of subclasses deciding to return false are near zero, and even if they would, it wouldn't break anything, so lets keep it at null|array.

Production build 0.71.5 2024