aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorJoas Schilling <coding@schilljs.com>2025-04-23 10:16:06 +0200
committerJoas Schilling <coding@schilljs.com>2025-04-23 12:38:18 +0200
commit9ed33cf6aa07089b99639404c309cf4a4972afdc (patch)
treef8944cb14083e21524569579a5774bbac2d7eda4 /lib
parent14868ac0eea9e7043b136c7b002c92072b0d0c37 (diff)
downloadnextcloud-server-feat/noid/profile-data-api.tar.gz
nextcloud-server-feat/noid/profile-data-api.zip
feat(profile): Add an API to get the profile field datafeat/noid/profile-data-api
Signed-off-by: Joas Schilling <coding@schilljs.com>
Diffstat (limited to 'lib')
-rw-r--r--lib/private/Profile/ProfileManager.php6
-rw-r--r--lib/public/Profile/IProfileManager.php4
2 files changed, 8 insertions, 2 deletions
diff --git a/lib/private/Profile/ProfileManager.php b/lib/private/Profile/ProfileManager.php
index 9d3d94fab21..13860286356 100644
--- a/lib/private/Profile/ProfileManager.php
+++ b/lib/private/Profile/ProfileManager.php
@@ -12,6 +12,7 @@ namespace OC\Profile;
use OC\AppFramework\Bootstrap\Coordinator;
use OC\Core\Db\ProfileConfig;
use OC\Core\Db\ProfileConfigMapper;
+use OC\Core\ResponseDefinitions;
use OC\KnownUser\KnownUserService;
use OC\Profile\Actions\EmailAction;
use OC\Profile\Actions\FediverseAction;
@@ -33,6 +34,9 @@ use Psr\Log\LoggerInterface;
use function array_flip;
use function usort;
+/**
+ * @psalm-import-type CoreProfileFields from ResponseDefinitions
+ */
class ProfileManager implements IProfileManager {
/** @var ILinkAction[] */
private array $actions = [];
@@ -223,7 +227,7 @@ class ProfileManager implements IProfileManager {
/**
* Return the profile parameters of the target user that are visible to the visiting user
* in an associative array
- * @return array{userId: string, address?: string|null, biography?: string|null, displayname?: string|null, headline?: string|null, isUserAvatarVisible?: bool, organisation?: string|null, pronouns?: string|null, role?: string|null, actions: list<array{id: string, icon: string, title: string, target: ?string}>}
+ * @psalm-return CoreProfileFields
*/
public function getProfileFields(IUser $targetUser, ?IUser $visitingUser): array {
$account = $this->accountManager->getAccount($targetUser);
diff --git a/lib/public/Profile/IProfileManager.php b/lib/public/Profile/IProfileManager.php
index 0a1e6733e58..f4e90e39d12 100644
--- a/lib/public/Profile/IProfileManager.php
+++ b/lib/public/Profile/IProfileManager.php
@@ -9,10 +9,12 @@ declare(strict_types=1);
namespace OCP\Profile;
+use OC\Core\ResponseDefinitions;
use OCP\Accounts\IAccountManager;
use OCP\IUser;
/**
+ * @psalm-import-type CoreProfileFields from ResponseDefinitions
* @since 28.0.0
*/
interface IProfileManager {
@@ -83,7 +85,7 @@ interface IProfileManager {
* Return the profile parameters of the target user that are visible to the visiting user
* in an associative array
*
- * @return array{userId: string, address?: string|null, biography?: string|null, displayname?: string|null, headline?: string|null, isUserAvatarVisible?: bool, organisation?: string|null, pronouns?: string|null, role?: string|null, actions: list<array{id: string, icon: string, title: string, target: ?string}>}
+ * @psalm-return CoreProfileFields
* @since 28.0.0
*/
public function getProfileFields(IUser $targetUser, ?IUser $visitingUser): array;