aboutsummaryrefslogtreecommitdiffstats
path: root/lib/private/Accounts/AccountProperty.php
diff options
context:
space:
mode:
Diffstat (limited to 'lib/private/Accounts/AccountProperty.php')
-rw-r--r--lib/private/Accounts/AccountProperty.php24
1 files changed, 3 insertions, 21 deletions
diff --git a/lib/private/Accounts/AccountProperty.php b/lib/private/Accounts/AccountProperty.php
index 0c4ad568709..3a89e9bbc7a 100644
--- a/lib/private/Accounts/AccountProperty.php
+++ b/lib/private/Accounts/AccountProperty.php
@@ -55,16 +55,11 @@ class AccountProperty implements IAccountProperty {
* @since 15.0.0
*/
public function setScope(string $scope): IAccountProperty {
- $newScope = $this->mapScopeToV2($scope);
- if (!in_array($newScope, [
- IAccountManager::SCOPE_LOCAL,
- IAccountManager::SCOPE_FEDERATED,
- IAccountManager::SCOPE_PRIVATE,
- IAccountManager::SCOPE_PUBLISHED
- ])) {
+ if (!in_array($scope, IAccountManager::ALLOWED_SCOPES, )) {
throw new InvalidArgumentException('Invalid scope');
}
- $this->scope = $newScope;
+ /** @var IAccountManager::SCOPE_* $scope */
+ $this->scope = $scope;
return $this;
}
@@ -105,19 +100,6 @@ class AccountProperty implements IAccountProperty {
return $this->scope;
}
- public static function mapScopeToV2(string $scope): string {
- if (str_starts_with($scope, 'v2-')) {
- return $scope;
- }
-
- return match ($scope) {
- IAccountManager::VISIBILITY_PRIVATE, '' => IAccountManager::SCOPE_LOCAL,
- IAccountManager::VISIBILITY_CONTACTS_ONLY => IAccountManager::SCOPE_FEDERATED,
- IAccountManager::VISIBILITY_PUBLIC => IAccountManager::SCOPE_PUBLISHED,
- default => $scope,
- };
- }
-
/**
* Get the verification status of a property
*