OpenIDConnect::createUser return type is wrong

Created on 5 February 2025, 9 days ago

Problem/Motivation

The return type for \Drupal\openid_connect\OpenIDConnect::createUser is UserInterface|null but it can never return null. This means that external code using this function needs to handle the null case, even though it doesn't exist.

Currently ::createUser calls \Drupal\externalauth\ExternalAuthInterface::register which only returns UserInterface. Following through to the implementation of that function confirms that null is never returned. Instead, if there is an issue creating a user then an exception is thrown.

Steps to reproduce

Proposed resolution

Drop null from the return type and documented typehint.

Remaining tasks

User interface changes

API changes

Data model changes

πŸ› Bug report
Status

Active

Version

3.0

Component

Code

Created by

πŸ‡¦πŸ‡ΊAustralia mstrelan

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

Production build 0.71.5 2024