fix(psalm): Satisfy psalm

Signed-off-by: Joas Schilling <coding@schilljs.com>
This commit is contained in:
Joas Schilling 2026-01-09 18:02:21 +01:00 committed by Maksim Sukharev
parent 3713f40d5b
commit 927bea2b4d
5 changed files with 11 additions and 4 deletions

View file

@ -4237,6 +4237,12 @@
<ImplementedReturnTypeMismatch>
<code><![CDATA[boolean|null]]></code>
</ImplementedReturnTypeMismatch>
<LessSpecificReturnStatement>
<code><![CDATA[$this->tokenProvider->getToken($password)]]></code>
</LessSpecificReturnStatement>
<MoreSpecificReturnType>
<code><![CDATA[?IToken]]></code>
</MoreSpecificReturnType>
<NoInterfaceProperties>
<code><![CDATA[$request->server]]></code>
<code><![CDATA[$request->server]]></code>

View file

@ -27,7 +27,7 @@ class Capabilities implements ICapability {
/**
* Return the core capabilities
*
* @return array{core: array{'user'?: array{language: string, locale: string, timezone: string} } }
* @return array{core: array{'user'?: array{language: string, locale: string, timezone: string}, 'can-create-app-token'?: bool } }
*/
public function getCapabilities(): array {
$capabilities = [];

View file

@ -25,6 +25,7 @@ use OCP\Authentication\Exceptions\CredentialsUnavailableException;
use OCP\Authentication\Exceptions\InvalidTokenException;
use OCP\Authentication\Exceptions\PasswordUnavailableException;
use OCP\Authentication\LoginCredentials\IStore;
use OCP\Authentication\Token\IToken as OCPIToken;
use OCP\EventDispatcher\IEventDispatcher;
use OCP\IConfig;
use OCP\IRequest;
@ -233,8 +234,7 @@ class AppPasswordController extends OCSController {
$credentials->getLoginName(),
$password,
$userAgent,
IToken::PERMANENT_TOKEN,
IToken::DO_NOT_REMEMBER
OCPIToken::PERMANENT_TOKEN,
);
$this->eventDispatcher->dispatchTyped(

View file

@ -24,6 +24,7 @@ use OCP\AppFramework\Db\TTransactional;
use OCP\AppFramework\Utility\ITimeFactory;
use OCP\Authentication\Exceptions\ExpiredTokenException;
use OCP\Authentication\Exceptions\InvalidTokenException;
use OCP\Authentication\Token\IToken as OCPIToken;
use OCP\EventDispatcher\GenericEvent;
use OCP\EventDispatcher\IEventDispatcher;
use OCP\Files\NotPermittedException;

View file

@ -26,7 +26,7 @@ interface IToken extends JsonSerializable {
*/
public const WIPE_TOKEN = 2;
/**
* @since 32.0.0
* @since 33.0.0
*/
public const ONETIME_TOKEN = 3;
/**