diff options
author | Faraz Samapoor <fsamapoor@gmail.com> | 2023-05-15 15:17:19 +0330 |
---|---|---|
committer | Faraz Samapoor <fsamapoor@gmail.com> | 2023-05-15 15:17:19 +0330 |
commit | e7cc7653b885c49b1b3f0a78f91ea05a53e102d8 (patch) | |
tree | 42da61d5c6e988d7c9eff7e081327a73f661dc89 /lib/private/Accounts | |
parent | 8bdb50fd507bfe68161ab98eba903872083ea4f3 (diff) | |
download | nextcloud-server-e7cc7653b885c49b1b3f0a78f91ea05a53e102d8.tar.gz nextcloud-server-e7cc7653b885c49b1b3f0a78f91ea05a53e102d8.zip |
Refactors "strpos" calls in lib/private to improve code readability.
Signed-off-by: Faraz Samapoor <fsamapoor@gmail.com>
Diffstat (limited to 'lib/private/Accounts')
-rw-r--r-- | lib/private/Accounts/AccountManager.php | 2 | ||||
-rw-r--r-- | lib/private/Accounts/AccountProperty.php | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/lib/private/Accounts/AccountManager.php b/lib/private/Accounts/AccountManager.php index 8fc16d5ce1a..1d64d604578 100644 --- a/lib/private/Accounts/AccountManager.php +++ b/lib/private/Accounts/AccountManager.php @@ -176,7 +176,7 @@ class AccountManager implements IAccountManager { if ($defaultRegion === '') { // When no default region is set, only +49… numbers are valid - if (strpos($input, '+') !== 0) { + if (!str_starts_with($input, '+')) { throw new InvalidArgumentException(self::PROPERTY_PHONE); } diff --git a/lib/private/Accounts/AccountProperty.php b/lib/private/Accounts/AccountProperty.php index a8e195feb98..2023d185a4b 100644 --- a/lib/private/Accounts/AccountProperty.php +++ b/lib/private/Accounts/AccountProperty.php @@ -145,7 +145,7 @@ class AccountProperty implements IAccountProperty { } public static function mapScopeToV2(string $scope): string { - if (strpos($scope, 'v2-') === 0) { + if (str_starts_with($scope, 'v2-')) { return $scope; } |