diff options
Diffstat (limited to 'lib/public/IAvatar.php')
-rw-r--r-- | lib/public/IAvatar.php | 44 |
1 files changed, 24 insertions, 20 deletions
diff --git a/lib/public/IAvatar.php b/lib/public/IAvatar.php index 8a1bc792450..d05a12e1dbf 100644 --- a/lib/public/IAvatar.php +++ b/lib/public/IAvatar.php @@ -36,66 +36,70 @@ use OCP\Files\SimpleFS\ISimpleFile; interface IAvatar { /** - * get the users avatar + * Get the users avatar + * * @param int $size size in px of the avatar, avatars are square, defaults to 64, -1 can be used to not scale the image - * @return boolean|\OCP\IImage containing the avatar or false if there's no image + * @return false|\OCP\IImage containing the avatar or false if there's no image * @since 6.0.0 - size of -1 was added in 9.0.0 */ - public function get($size = 64); + public function get(int $size = 64); /** * Check if an avatar exists for the user * - * @return bool * @since 8.1.0 */ - public function exists(); + public function exists(): bool; /** * Check if the avatar of a user is a custom uploaded one * - * @return bool * @since 14.0.0 */ public function isCustomAvatar(): bool; /** - * sets the users avatar + * Sets the users avatar + * * @param \OCP\IImage|resource|string $data An image object, imagedata or path to set a new avatar * @throws \Exception if the provided file is not a jpg or png image * @throws \Exception if the provided image is not valid * @throws \OC\NotSquareException if the image is not square - * @return void * @since 6.0.0 */ - public function set($data); + public function set($data): void; /** - * remove the users avatar - * @return void + * Remove the user's avatar + * + * @param bool $silent Whether removing the avatar should trigger a change * @since 6.0.0 */ - public function remove(); + public function remove(bool $silent = false): void; /** * Get the file of the avatar - * @param int $size -1 can be used to not scale the image - * @return ISimpleFile + * + * @param int $size The desired image size. -1 can be used to not scale the image * @throws NotFoundException * @since 9.0.0 */ - public function getFile($size); + public function getFile(int $size): ISimpleFile; /** - * @param string $text - * @return Color Object containting r g b int in the range [0, 255] + * Get the avatar background color + * * @since 14.0.0 */ - public function avatarBackgroundColor(string $text); + public function avatarBackgroundColor(string $hash): Color; /** - * Handle a changed user + * Updates the display name if changed. + * + * @param string $feature The changed feature + * @param mixed $oldValue The previous value + * @param mixed $newValue The new value * @since 13.0.0 */ - public function userChanged($feature, $oldValue, $newValue); + public function userChanged(string $feature, $oldValue, $newValue): void; } |