Problem/Motivation
While running tests of the next major PHP version for OpenID Connect, we started seeing the following deprecation messages coming from ExternalAuth:
Deprecated: Drupal\externalauth\Authmap::delete(): Implicitly marking parameter $provider as nullable is deprecated, the explicit nullable type must be used instead in /builds/project/openid_connect/web/modules/contrib/externalauth/src/Authmap.php on line 123
Deprecated: Drupal\externalauth\AuthmapInterface::delete(): Implicitly marking parameter $provider as nullable is deprecated, the explicit nullable type must be used instead in /builds/project/openid_connect/web/modules/contrib/externalauth/src/AuthmapInterface.php on line 90
Those messages are displaying here: https://git.drupalcode.org/project/openid_connect/-/jobs/3848290#L188
Proposed resolution
Change the method definition from:
public function delete(int $uid, string $provider = NULL) {
to
public function delete(int $uid, ?string $provider = NULL) {
Comments
Comment #2
deepali sardana commentedComment #4
deepali sardana commentedComment #5
pfrillingLeft a few comments in the MR that need to should be addressed.
Comment #7
idebr commentedThe remaining deprecations are now fixed in the merge request
Comment #8
pfrillingLooks good. I believe they were all addressed.
Comment #9
svendecabooterThanks for the improvements. Merged now