aboutsummaryrefslogtreecommitdiffstats
path: root/lib/private/Accounts
diff options
context:
space:
mode:
authorFaraz Samapoor <fsamapoor@gmail.com>2023-05-15 15:17:19 +0330
committerFaraz Samapoor <fsamapoor@gmail.com>2023-05-15 15:17:19 +0330
commite7cc7653b885c49b1b3f0a78f91ea05a53e102d8 (patch)
tree42da61d5c6e988d7c9eff7e081327a73f661dc89 /lib/private/Accounts
parent8bdb50fd507bfe68161ab98eba903872083ea4f3 (diff)
downloadnextcloud-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.php2
-rw-r--r--lib/private/Accounts/AccountProperty.php2
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;
}