Skip to content
Prev Previous commit
Next Next commit
Improve docblock annotations for tokens and their exceptions
Signed-off-by: Côme Chilliet <[email protected]>
  • Loading branch information
come-nc committed Oct 23, 2023
commit 33a24134a7cb6b7af08a097a5807c58888cba8c6
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
use OC\Authentication\Token\IToken;

/**
* @deprecated 28.0.0 use OCP version instead
* @deprecated 28.0.0 use {@see \OCP\Authentication\Exceptions\ExpiredTokenException} instead
*/
class ExpiredTokenException extends \OCP\Authentication\Exceptions\ExpiredTokenException {
public function __construct(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
use OC\Authentication\Token\IToken;

/**
* @deprecated 28.0.0 use OCP version instead
* @deprecated 28.0.0 use {@see \OCP\Authentication\Exceptions\WipeTokenException} instead
*/
class WipeTokenException extends \OCP\Authentication\Exceptions\WipeTokenException {
public function __construct(
Expand Down
3 changes: 3 additions & 0 deletions lib/private/Authentication/Token/IToken.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,5 +28,8 @@

use OCP\Authentication\Token\IToken as OCPIToken;

/**
* @deprecated 28.0.0 use {@see \OCP\Authentication\Token\IToken} instead
*/
interface IToken extends OCPIToken {
}
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,11 @@
use OCP\Authentication\Token\IToken;

/**
* @since 28.0
* @since 28.0.0
*/
class ExpiredTokenException extends InvalidTokenException {
/**
* @since 28.0
* @since 28.0.0
*/
public function __construct(
private IToken $token,
Expand All @@ -41,7 +41,7 @@ public function __construct(
}

/**
* @since 28.0
* @since 28.0.0
*/
public function getToken(): IToken {
return $this->token;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
use Exception;

/**
* @since 28.0
* @since 28.0.0
*/
class InvalidTokenException extends Exception {
}
6 changes: 3 additions & 3 deletions lib/public/Authentication/Exceptions/WipeTokenException.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,11 @@
use OCP\Authentication\Token\IToken;

/**
* @since 28.0
* @since 28.0.0
*/
class WipeTokenException extends InvalidTokenException {
/**
* @since 28.0
* @since 28.0.0
*/
public function __construct(
private IToken $token,
Expand All @@ -41,7 +41,7 @@ public function __construct(
}

/**
* @since 28.0
* @since 28.0.0
*/
public function getToken(): IToken {
return $this->token;
Expand Down
15 changes: 15 additions & 0 deletions lib/public/Authentication/Token/IToken.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,25 @@
* @since 28.0.0
*/
interface IToken extends JsonSerializable {
/**
* @since 28.0.0
*/
public const TEMPORARY_TOKEN = 0;
/**
* @since 28.0.0
*/
public const PERMANENT_TOKEN = 1;
/**
* @since 28.0.0
*/
public const WIPE_TOKEN = 2;
/**
* @since 28.0.0
*/
public const DO_NOT_REMEMBER = 0;
/**
* @since 28.0.0
*/
public const REMEMBER = 1;

/**
Expand Down