Allow passing null to PublicKeyToken::setScope, fixes tests

Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
pull/41017/head
Côme Chilliet 2 years ago
parent 33a24134a7
commit d8b42c6131
No known key found for this signature in database
GPG Key ID: A3E2F658B28C760A
  1. 4
      lib/private/Authentication/Token/PublicKeyToken.php

@ -187,11 +187,11 @@ class PublicKeyToken extends Entity implements INamedToken, IWipeableToken {
return $scope;
}
public function setScope(string|array $scope): void {
public function setScope(array|string|null $scope): void {
if (is_array($scope)) {
parent::setScope(json_encode($scope));
} else {
parent::setScope($scope);
parent::setScope((string)$scope);
}
}

Loading…
Cancel
Save