aboutsummaryrefslogtreecommitdiffstats
path: root/lib/private/Accounts
diff options
context:
space:
mode:
authorRobin Appelman <robin@icewind.nl>2023-06-01 23:10:00 +0200
committerGitHub <noreply@github.com>2023-06-01 23:10:00 +0200
commit9f1d497a0b4dbda86e676a3a55758bc2909cc781 (patch)
tree968db9431470d4d0e1ea7c80caed373fc9029120 /lib/private/Accounts
parente81fdfefab6d46b9d326b70c278d52fbb941a431 (diff)
parentfa31c707c0a4c2a72141b8017e66561710185a06 (diff)
downloadnextcloud-server-9f1d497a0b4dbda86e676a3a55758bc2909cc781.tar.gz
nextcloud-server-9f1d497a0b4dbda86e676a3a55758bc2909cc781.zip
Merge pull request #38261 from fsamapoor/replace_strpos_calls_in_lib_private
Refactors "strpos" calls in lib/private to improve code readability.
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 81c53d368ec..60065272a58 100644
--- a/lib/private/Accounts/AccountManager.php
+++ b/lib/private/Accounts/AccountManager.php
@@ -175,7 +175,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;
}