Skip to content
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
97 commits
Select commit Hold shift + click to select a range
699efb4
Highlight selected file version
Jerome-Herbinet May 19, 2022
8527902
Following @nimishavijay suggestion
Jerome-Herbinet May 20, 2022
4d61008
New changes following nimishavijay suggestions
Jerome-Herbinet May 23, 2022
6e0c641
Make chunkperf.php work again
kesselb May 16, 2022
08499f2
Remove chunkperf.php
kesselb May 17, 2022
adbf3f4
Port share by mail settings to vue
CarlSchwan May 17, 2022
55e09a0
[tx-robot] updated from transifex
nextcloud-bot May 20, 2022
e26acc1
Fix crop condition
CarlSchwan May 19, 2022
4aa272c
Add explicit return if getSmallImagePreview fails
juliusknorr May 16, 2022
932e969
Use custom PHP runtime for PHPUnit execution in autotest
ChristophWurst May 19, 2022
f2f54f3
Fix spelling for PreConditionNotMetException
kesselb May 15, 2022
855fecb
Improve two factor admin settings
CarlSchwan May 19, 2022
27b4652
Make appName of TemplateResponse accessible in BeforeTemplateRendered…
nickvergessen May 20, 2022
c8b1efc
Port admin federated files sharing to vue
CarlSchwan May 17, 2022
a0463c8
Rename userName to username to align with child classes
kesselb May 18, 2022
eba2d4c
Fix return type for createSpecificUser
kesselb May 18, 2022
6c1ff6d
Cleanup admin delegation setting page
CarlSchwan May 19, 2022
eaacb3a
Port BackgroundJob admin settings to vue
CarlSchwan May 16, 2022
2215b6b
[tx-robot] updated from transifex
nextcloud-bot May 21, 2022
557dd64
Bump sass from 1.50.0 to 1.52.1
dependabot[bot] May 21, 2022
cb1a118
[tx-robot] updated from transifex
nextcloud-bot May 22, 2022
cb977dd
Update psalm baseline
nextcloud-command May 22, 2022
244cfb6
[tx-robot] updated from transifex
nextcloud-bot May 23, 2022
3bcf674
Rename user-agent used by the Webcal Refresh Service
tcitworld May 20, 2022
44d13d5
Fix psalm issues related to the user backend
CarlSchwan May 13, 2022
196804b
Update DAV availability vue component to standard
nickvergessen May 23, 2022
42cd730
[tx-robot] updated from transifex
nextcloud-bot May 24, 2022
06e56ad
Adjust docs to the same as the implementation
nickvergessen May 23, 2022
014602a
Add API to change preferences
nickvergessen May 23, 2022
f38c525
Revert api break
CarlSchwan May 23, 2022
42c483f
Remove at() matcher for tests for files app
come-nc May 24, 2022
1e53429
Fix various errors reported by eslint
CarlSchwan May 23, 2022
c1d7522
Improve warning about missing pnctl
CarlSchwan May 24, 2022
e69317d
Fix return type and make type stricter
CarlSchwan May 23, 2022
7d096d1
Modernize the dav admin settings
CarlSchwan May 23, 2022
66bc45b
Require a recent phpunit version in integration and acceptance
come-nc Mar 30, 2022
2eb5d5f
[tx-robot] updated from transifex
nextcloud-bot May 25, 2022
77a66e3
Fix handling events without names in activities
nickvergessen May 24, 2022
05dc012
Also trim the name
nickvergessen May 25, 2022
44c903c
Remove at() matcher use from encryption tests
come-nc May 24, 2022
31a50f4
Remove at() matcher in files_sharing tests
come-nc May 24, 2022
444b0fc
[tx-robot] updated from transifex
nextcloud-bot May 26, 2022
6a21cd5
[tx-robot] updated from transifex
nextcloud-bot May 27, 2022
09a9949
Fix missing status with predefined status in drop-down
nickvergessen May 27, 2022
fe0b116
Don't overwrite certain values if the refreshing comes in via short u…
nickvergessen May 27, 2022
2e4b91f
Fix unit tests
nickvergessen May 27, 2022
1994c93
Move Gd failed operations to debug level
solracsf May 25, 2022
c324a12
Add lint job for PHP8.2
ChristophWurst May 25, 2022
9bc4bdf
allow use of rememberme cookies for IApacheAuth backends
blizzz May 25, 2022
cec5d3d
Introduce event for loading additional script on projects
juliusknorr May 12, 2022
e83660a
Move files_sharing over to new event for projects
juliusknorr May 12, 2022
a39b75d
Fix loading groupfolder info when share api is disabled
CarlSchwan May 25, 2022
ef8a240
[tx-robot] updated from transifex
nextcloud-bot May 29, 2022
3cf2a49
[tx-robot] updated from transifex
nextcloud-bot May 30, 2022
0879c40
Handle non existing settings again
CarlSchwan May 30, 2022
4bf25d8
Update core to PHP 7.4 standard
CarlSchwan Apr 12, 2022
cc5e208
Update psalm baseline
nextcloud-command May 30, 2022
5991447
Fix node tests ci
CarlSchwan May 25, 2022
70d7366
Fix docblock for return type
kesselb May 27, 2022
0937961
Bump core-js from 3.22.5 to 3.22.7
dependabot[bot] May 30, 2022
27ac597
Add a method to get estimated export size in IMigrator
come-nc Apr 28, 2022
4c3cb6f
Implement getExportEstimatedSize in migrators
come-nc Apr 28, 2022
f948c35
Move new IMigrator method to a specific interface ISizeEstimationMigr…
come-nc May 24, 2022
1ffd766
Add the ISizeEstimationMigrator interface for method getExportEstimat…
come-nc May 24, 2022
300d01b
Update method name
Pytal Apr 29, 2022
283340a
Skip avatar on failure
Pytal Apr 29, 2022
ff21c79
Update contacts estimation
Pytal Apr 29, 2022
bc1d109
Update calendar estimation
Pytal Apr 29, 2022
ec047d5
[tx-robot] updated from transifex
nextcloud-bot May 31, 2022
5d217a6
Properly calculate primary element based on background luminance
skjnldsv May 20, 2022
e8156e5
Cleanup tempfiles after each cron job run
juliusknorr May 30, 2022
c7c8558
Use JSON_THROW_ON_ERROR instead of custom error handling
juliusknorr May 27, 2022
25b83a1
Fix Nextcloud Android app not showing proper name
May 24, 2022
88ea2f2
Improve JSConfigHelper code quality a bit
nickvergessen May 25, 2022
9b04ed8
Restore old behaviour of sending flase for not found apps
nickvergessen May 30, 2022
b4c5343
Fix unit tests
nickvergessen May 31, 2022
f74f2fd
Update psalm baseline
nextcloud-command May 31, 2022
8c2c1b4
Use SettingsSection in workflowengine settings
CarlSchwan May 19, 2022
77c6c54
Update 3rdparty for symfony/translation:4.4.41
nickvergessen May 30, 2022
c531391
Fix docblock for addFileFromStream
kesselb May 18, 2022
adfc56b
Fix type for resource
kesselb May 18, 2022
d08ef7b
Update psalm-baseline
kesselb May 31, 2022
c8f269b
Fix share permissions rendering
artonge May 31, 2022
583e1ba
Check background job type
ChristophWurst May 31, 2022
77f4474
[tx-robot] updated from transifex
nextcloud-bot Jun 1, 2022
4722e0e
More meaningfull message when a public authenticated share's password…
StCyr May 31, 2022
4f9c0bd
Fix small typo
CarlSchwan Jun 1, 2022
fc8e1c1
Make X-HAS-{MD5/SHA256} opt-in
CarlSchwan Jun 1, 2022
e741da5
Make sure activities are not created when a deleted calendar object e…
tcitworld May 18, 2022
3b5120a
[tx-robot] updated from transifex
nextcloud-bot Jun 2, 2022
04079d9
Use Image class from public API
Pytal Jun 2, 2022
faa931e
Trim mount point before matching in encryption code
PVince81 Jun 1, 2022
7a03112
Add unit tests for encryption's isSystemWideMountPoint
PVince81 Jun 1, 2022
cd074e5
Debug log what happens during reminders processing
ChristophWurst Sep 3, 2021
df14d37
Highlight selected file version
Jerome-Herbinet May 19, 2022
ad1c428
Following @nimishavijay suggestion
Jerome-Herbinet May 20, 2022
3cba916
New changes following nimishavijay suggestions
Jerome-Herbinet May 23, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Fix psalm issues related to the user backend
- Reflect the actual return value returned by the implementation in the
  the interface. E.g. IUser|bool -> IUser|false
- Remove $hasLoggedIn parameter from private countUser implementation.
  Replace the two call with the equivalent countSeenUser
- getBackend is nuallable, add this to the interface
- Use backend interface to make psalm happy about call to undefined
  methods. Also helps with getting rid at some point of the old
  implementActions

Signed-off-by: Carl Schwan <[email protected]>
  • Loading branch information
CarlSchwan authored and Jerome-Herbinet committed Jun 3, 2022
commit 44d13d56236291a675ba6d8febfe046a15855506
56 changes: 3 additions & 53 deletions build/psalm-baseline.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4157,28 +4157,11 @@
<FalsableReturnStatement occurrences="1">
<code>false</code>
</FalsableReturnStatement>
<ImplicitToStringCast occurrences="1">
<code>$query-&gt;func()-&gt;lower('displayname')</code>
</ImplicitToStringCast>
</file>
<file src="lib/private/User/Manager.php">
<ImplementedReturnTypeMismatch occurrences="1">
<code>array|int</code>
</ImplementedReturnTypeMismatch>
<InvalidArgument occurrences="1">
<code>$callback</code>
</InvalidArgument>
<InvalidNullableReturnType occurrences="1">
<code>bool|IUser</code>
</InvalidNullableReturnType>
<NullableReturnStatement occurrences="2">
<code>$this-&gt;createUserFromBackend($uid, $password, $backend)</code>
<code>$this-&gt;createUserFromBackend($uid, $password, $backend)</code>
</NullableReturnStatement>
<UndefinedInterfaceMethod occurrences="5">
<code>checkPassword</code>
<code>checkPassword</code>
<code>countUsers</code>
<ImplementedReturnTypeMismatch occurrences="1"/>
<InvalidArgument occurrences="1"/>
<UndefinedInterfaceMethod occurrences="2">
<code>createUser</code>
<code>getUsersForUserValueCaseInsensitive</code>
</UndefinedInterfaceMethod>
Expand All @@ -4190,23 +4173,13 @@
<InvalidArgument occurrences="1">
<code>IUser::class . '::firstLogin'</code>
</InvalidArgument>
<InvalidScalarArgument occurrences="2">
<code>$this-&gt;timeFactory-&gt;getTime()</code>
<code>$this-&gt;timeFactory-&gt;getTime()</code>
</InvalidScalarArgument>
<NoInterfaceProperties occurrences="2">
<code>$request-&gt;server</code>
<code>$request-&gt;server</code>
</NoInterfaceProperties>
<NullableReturnStatement occurrences="1">
<code>null</code>
</NullableReturnStatement>
<TooManyArguments occurrences="1">
<code>dispatch</code>
</TooManyArguments>
<UndefinedMethod occurrences="1">
<code>getByEmail</code>
</UndefinedMethod>
</file>
<file src="lib/private/User/User.php">
<InvalidArgument occurrences="5">
Expand All @@ -4216,36 +4189,13 @@
<code>IUser::class . '::preDelete'</code>
<code>IUser::class . '::preSetPassword'</code>
</InvalidArgument>
<InvalidNullableReturnType occurrences="1">
<code>getBackend</code>
</InvalidNullableReturnType>
<InvalidReturnStatement occurrences="1">
<code>$image</code>
</InvalidReturnStatement>
<InvalidReturnType occurrences="1">
<code>IImage|null</code>
</InvalidReturnType>
<InvalidScalarArgument occurrences="2">
<code>$quota</code>
<code>$this-&gt;lastLogin</code>
</InvalidScalarArgument>
<NullableReturnStatement occurrences="1">
<code>$this-&gt;backend</code>
</NullableReturnStatement>
<TooManyArguments occurrences="5">
<code>dispatch</code>
<code>dispatch</code>
<code>dispatch</code>
<code>dispatch</code>
<code>dispatch</code>
</TooManyArguments>
<UndefinedInterfaceMethod occurrences="5">
<code>canChangeAvatar</code>
<code>deleteUserAvatar</code>
<code>getHome</code>
<code>setDisplayName</code>
<code>setPassword</code>
</UndefinedInterfaceMethod>
</file>
<file src="lib/private/legacy/OC_API.php">
<InvalidNullableReturnType occurrences="1">
Expand Down
2 changes: 1 addition & 1 deletion lib/private/DB/QueryBuilder/QueryBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -1096,7 +1096,7 @@ public function orHaving(...$having) {
* Specifies an ordering for the query results.
* Replaces any previously specified orderings, if any.
*
* @param string $sort The ordering expression.
* @param string|IQueryFunction|ILiteral|IParameter $sort The ordering expression.
* @param string $order The ordering direction.
*
* @return $this This QueryBuilder instance.
Expand Down
2 changes: 1 addition & 1 deletion lib/private/User/Database.php
Original file line number Diff line number Diff line change
Expand Up @@ -275,7 +275,7 @@ public function getDisplayNames($search = '', $limit = null, $offset = null) {
->setMaxResults($limit)
->setFirstResult($offset);

$result = $query->execute();
$result = $query->executeQuery();
$displayNames = [];
while ($row = $result->fetch()) {
$displayNames[(string)$row['uid']] = (string)$row['displayname'];
Expand Down
3 changes: 2 additions & 1 deletion lib/private/User/LazyUser.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@

use OCP\IUser;
use OCP\IUserManager;
use OCP\UserInterface;

class LazyUser implements IUser {
private ?IUser $user = null;
Expand Down Expand Up @@ -83,7 +84,7 @@ public function getBackendClassName() {
return $this->getUser()->getBackendClassName();
}

public function getBackend() {
public function getBackend(): ?UserInterface {
return $this->getUser()->getBackend();
}

Expand Down
30 changes: 16 additions & 14 deletions lib/private/User/Manager.php
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,8 @@
use OCP\Support\Subscription\IRegistry;
use OCP\User\Backend\IGetRealUIDBackend;
use OCP\User\Backend\ISearchKnownUsersBackend;
use OCP\User\Backend\ICheckPasswordBackend;
use OCP\User\Backend\ICountUsersBackend;
use OCP\User\Events\BeforeUserCreatedEvent;
use OCP\User\Events\UserCreatedEvent;
use OCP\UserInterface;
Expand Down Expand Up @@ -223,7 +225,7 @@ public function userExists($uid) {
*
* @param string $loginName
* @param string $password
* @return mixed the User object on success, false otherwise
* @return IUser|false the User object on success, false otherwise
*/
public function checkPassword($loginName, $password) {
$result = $this->checkPasswordNoLogging($loginName, $password);
Expand Down Expand Up @@ -254,7 +256,8 @@ public function checkPasswordNoLogging($loginName, $password) {
$backends = $this->backends;
}
foreach ($backends as $backend) {
if ($backend->implementsActions(Backend::CHECK_PASSWORD)) {
if ($backend instanceof ICheckPasswordBackend || $backend->implementsActions(Backend::CHECK_PASSWORD)) {
/** @var ICheckPasswordBackend $backend */
$uid = $backend->checkPassword($loginName, $password);
if ($uid !== false) {
return $this->getUserObject($uid, $backend);
Expand All @@ -268,7 +271,8 @@ public function checkPasswordNoLogging($loginName, $password) {
$password = urldecode($password);

foreach ($backends as $backend) {
if ($backend->implementsActions(Backend::CHECK_PASSWORD)) {
if ($backend instanceof ICheckPasswordBackend || $backend->implementsActions(Backend::CHECK_PASSWORD)) {
/** @var ICheckPasswordBackend|UserInterface $backend */
$uid = $backend->checkPassword($loginName, $password);
if ($uid !== false) {
return $this->getUserObject($uid, $backend);
Expand Down Expand Up @@ -376,7 +380,7 @@ public function searchKnownUsersByDisplayName(string $searcher, string $pattern,
* @param string $uid
* @param string $password
* @throws \InvalidArgumentException
* @return bool|IUser the created user or false
* @return false|IUser the created user or false
*/
public function createUser($uid, $password) {
// DI injection is not used here as IRegistry needs the user manager itself for user count and thus it would create a cyclic dependency
Expand Down Expand Up @@ -415,7 +419,7 @@ public function createUser($uid, $password) {
* @param string $uid
* @param string $password
* @param UserInterface $backend
* @return IUser|null
* @return IUser|false
* @throws \InvalidArgumentException
*/
public function createUserFromBackend($uid, $password, UserInterface $backend) {
Expand Down Expand Up @@ -469,25 +473,23 @@ public function createUserFromBackend($uid, $password, UserInterface $backend) {
/** @deprecated 21.0.0 use UserCreatedEvent event with the IEventDispatcher instead */
$this->emit('\OC\User', 'postCreateUser', [$user, $password]);
$this->eventDispatcher->dispatchTyped(new UserCreatedEvent($user, $password));
return $user;
}
return $user;
return false;
}

/**
* returns how many users per backend exist (if supported by backend)
*
* @param boolean $hasLoggedIn when true only users that have a lastLogin
* entry in the preferences table will be affected
* @return array|int an array of backend class as key and count number as value
* if $hasLoggedIn is true only an int is returned
* @return array<string, int> an array of backend class as key and count number as value
*/
public function countUsers($hasLoggedIn = false) {
if ($hasLoggedIn) {
return $this->countSeenUsers();
}
public function countUsers() {
$userCountStatistics = [];
foreach ($this->backends as $backend) {
if ($backend->implementsActions(Backend::COUNT_USERS)) {
if ($backend instanceof ICountUsersBackend || $backend->implementsActions(Backend::COUNT_USERS)) {
/** @var ICountUsersBackend|IUserBackend $backend */
$backendUsers = $backend->countUsers();
if ($backendUsers !== false) {
if ($backend instanceof IUserBackend) {
Expand Down Expand Up @@ -528,7 +530,7 @@ public function countUsersOfGroups(array $groups) {
* The callback is executed for each user on each backend.
* If the callback returns false no further users will be retrieved.
*
* @param \Closure $callback
* @psalm-param \Closure(\OCP\IUser):?bool $callback
* @param string $search
* @param boolean $onlySeen when true only users that have a lastLogin entry
* in the preferences table will be affected
Expand Down
10 changes: 5 additions & 5 deletions lib/private/User/Session.php
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@
*/
class Session implements IUserSession, Emitter {

/** @var Manager|PublicEmitter $manager */
/** @var Manager $manager */
private $manager;

/** @var ISession $session */
Expand Down Expand Up @@ -288,9 +288,9 @@ public function setLoginName($loginName) {
}

/**
* get the login name of the current user
* Get the login name of the current user
*
* @return string
* @return ?string
*/
public function getLoginName() {
if ($this->activeUser) {
Expand Down Expand Up @@ -870,7 +870,7 @@ public function loginWithCookie($uid, $currentToken, $oldSessionId) {
// replace successfully used token with a new one
$this->config->deleteUserValue($uid, 'login_token', $currentToken);
$newToken = $this->random->generate(32);
$this->config->setUserValue($uid, 'login_token', $newToken, $this->timeFactory->getTime());
$this->config->setUserValue($uid, 'login_token', $newToken, (string)$this->timeFactory->getTime());

try {
$sessionId = $this->session->getId();
Expand Down Expand Up @@ -905,7 +905,7 @@ public function loginWithCookie($uid, $currentToken, $oldSessionId) {
*/
public function createRememberMeToken(IUser $user) {
$token = $this->random->generate(32);
$this->config->setUserValue($user->getUID(), 'login_token', $token, $this->timeFactory->getTime());
$this->config->setUserValue($user->getUID(), 'login_token', $token, (string)$this->timeFactory->getTime());
$this->setMagicInCookie($user->getUID(), $token);
}

Expand Down
31 changes: 21 additions & 10 deletions lib/private/User/User.php
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,10 @@
use OCP\User\Events\BeforeUserDeletedEvent;
use OCP\User\Events\UserDeletedEvent;
use OCP\User\GetQuotaEvent;
use OCP\User\Backend\ISetDisplayNameBackend;
use OCP\User\Backend\ISetPasswordBackend;
use OCP\User\Backend\IProvideAvatarBackend;
use OCP\User\Backend\IGetHomeBackend;
use OCP\UserInterface;
use Symfony\Component\EventDispatcher\EventDispatcherInterface;
use Symfony\Component\EventDispatcher\GenericEvent;
Expand Down Expand Up @@ -155,7 +159,9 @@ public function setDisplayName($displayName) {
$displayName = trim($displayName);
$oldDisplayName = $this->getDisplayName();
if ($this->backend->implementsActions(Backend::SET_DISPLAYNAME) && !empty($displayName) && $displayName !== $oldDisplayName) {
$result = $this->backend->setDisplayName($this->uid, $displayName);
/** @var ISetDisplayNameBackend $backend */
$backend = $this->backend;
$result = $backend->setDisplayName($this->uid, $displayName);
if ($result) {
$this->displayName = $displayName;
$this->triggerChange('displayName', $displayName, $oldDisplayName);
Expand Down Expand Up @@ -241,7 +247,7 @@ public function updateLastLoginTimestamp() {
$firstTimeLogin = ($this->getLastLogin() === 0);
$this->lastLogin = time();
$this->config->setUserValue(
$this->uid, 'login', 'lastLogin', $this->lastLogin);
$this->uid, 'login', 'lastLogin', (string)$this->lastLogin);

return $firstTimeLogin;
}
Expand Down Expand Up @@ -280,7 +286,7 @@ public function delete() {
\OC::$server->getCommentsManager()->deleteReferencesOfActor('users', $this->uid);
\OC::$server->getCommentsManager()->deleteReadMarksFromUser($this);

/** @var IAvatarManager $avatarManager */
/** @var AvatarManager $avatarManager */
$avatarManager = \OC::$server->query(AvatarManager::class);
$avatarManager->deleteUserAvatar($this->uid);

Expand Down Expand Up @@ -319,7 +325,9 @@ public function setPassword($password, $recoveryPassword = null) {
$this->emitter->emit('\OC\User', 'preSetPassword', [$this, $password, $recoveryPassword]);
}
if ($this->backend->implementsActions(Backend::SET_PASSWORD)) {
$result = $this->backend->setPassword($this->uid, $password);
/** @var ISetPasswordBackend $backend */
$backend = $this->backend;
$result = $backend->setPassword($this->uid, $password);

if ($result !== false) {
$this->legacyDispatcher->dispatch(IUser::class . '::postSetPassword', new GenericEvent($this, [
Expand All @@ -344,7 +352,8 @@ public function setPassword($password, $recoveryPassword = null) {
*/
public function getHome() {
if (!$this->home) {
if ($this->backend->implementsActions(Backend::GET_HOME) and $home = $this->backend->getHome($this->uid)) {
/** @psalm-suppress UndefinedInterfaceMethod Once we get rid of the legacy implementsActions, psalm won't complain anymore */
if (($this->backend instanceof IGetHomeBackend || $this->backend->implementsActions(Backend::GET_HOME)) && $home = $this->backend->getHome($this->uid)) {
$this->home = $home;
} elseif ($this->config) {
$this->home = $this->config->getSystemValue('datadirectory', \OC::$SERVERROOT . '/data') . '/' . $this->uid;
Expand All @@ -367,18 +376,20 @@ public function getBackendClassName() {
return get_class($this->backend);
}

public function getBackend() {
public function getBackend(): ?UserInterface {
return $this->backend;
}

/**
* check if the backend allows the user to change his avatar on Personal page
* Check if the backend allows the user to change his avatar on Personal page
*
* @return bool
*/
public function canChangeAvatar() {
if ($this->backend->implementsActions(Backend::PROVIDE_AVATAR)) {
return $this->backend->canChangeAvatar($this->uid);
if ($this->backend instanceof IProvideAvatarBackend || $this->backend->implementsActions(Backend::PROVIDE_AVATAR)) {
/** @var IProvideAvatarBackend $backend */
$backend = $this->backend;
return $backend->canChangeAvatar($this->uid);
}
return true;
}
Expand Down Expand Up @@ -501,7 +512,7 @@ public function setQuota($quota) {
$oldQuota = $this->config->getUserValue($this->uid, 'files', 'quota', '');
if ($quota !== 'none' and $quota !== 'default') {
$quota = OC_Helper::computerFileSize($quota);
$quota = OC_Helper::humanFileSize($quota);
$quota = OC_Helper::humanFileSize((int)$quota);
}
if ($quota !== $oldQuota) {
$this->config->setUserValue($this->uid, 'files', 'quota', $quota);
Expand Down
2 changes: 1 addition & 1 deletion lib/public/DB/QueryBuilder/IQueryBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -820,7 +820,7 @@ public function orHaving(...$having);
* Specifies an ordering for the query results.
* Replaces any previously specified orderings, if any.
*
* @param string $sort The ordering expression.
* @param string|IQueryFunction $sort The ordering expression.
* @param string $order The ordering direction.
*
* @return $this This QueryBuilder instance.
Expand Down
2 changes: 1 addition & 1 deletion lib/public/IAvatar.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ interface IAvatar {
/**
* 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);
Expand Down
3 changes: 1 addition & 2 deletions lib/public/IUser.php
Original file line number Diff line number Diff line change
Expand Up @@ -113,10 +113,9 @@ public function getBackendClassName();
/**
* Get the backend for the current user object
*
* @return UserInterface
* @since 15.0.0
*/
public function getBackend();
public function getBackend(): ?UserInterface;

/**
* check if the backend allows the user to change his avatar on Personal page
Expand Down
Loading