Use native union types in most places.

This commit is contained in:
wn_
2024-11-23 17:43:24 +00:00
parent d4636716fb
commit abcd0e8ba2
24 changed files with 70 additions and 145 deletions

View File

@@ -16,11 +16,10 @@ abstract class Auth_Base extends Plugin implements IAuthModule {
* Can be used instead of find_user_by_login() by external auth modules
* @param string $login
* @param string|false $password
* @return null|int
* @throws Exception
* @throws PDOException
*/
function auto_create_user(string $login, $password = false) {
function auto_create_user(string $login, false|string $password = false): ?int {
if ($login && Config::get(Config::AUTH_AUTO_CREATE)) {
$user_id = UserHelper::find_user_by_login($login);
@@ -49,11 +48,9 @@ abstract class Auth_Base extends Plugin implements IAuthModule {
/** replaced with UserHelper::find_user_by_login()
* @param string $login
* @return null|int
* @deprecated
*/
function find_user_by_login(string $login) {
function find_user_by_login(string $login): ?int {
return UserHelper::find_user_by_login($login);
}
}