From fdd4ba0e2ce445d5569301ee15d46b4e255fa60b Mon Sep 17 00:00:00 2001 From: David Grudl Date: Sun, 27 Nov 2022 22:32:30 +0100 Subject: [PATCH] uppercase constants marked as deprecated --- src/Security/Authenticator.php | 17 +++++++++++------ src/Security/Authorizator.php | 5 +++++ src/Security/User.php | 14 +++++++++----- src/Security/UserStorage.php | 3 +++ 4 files changed, 28 insertions(+), 11 deletions(-) diff --git a/src/Security/Authenticator.php b/src/Security/Authenticator.php index 05a2ac1d..4bc1df39 100644 --- a/src/Security/Authenticator.php +++ b/src/Security/Authenticator.php @@ -22,12 +22,17 @@ interface Authenticator Failure = 3, NotApproved = 4; - /** Deprecated */ - public const - IDENTITY_NOT_FOUND = self::IdentityNotFound, - INVALID_CREDENTIAL = self::InvalidCredential, - FAILURE = self::Failure, - NOT_APPROVED = self::NotApproved; + /** @deprecated use Authenticator::IdentityNotFound */ + public const IDENTITY_NOT_FOUND = self::IdentityNotFound; + + /** @deprecated use Authenticator::InvalidCredential */ + public const INVALID_CREDENTIAL = self::InvalidCredential; + + /** @deprecated use Authenticator::Failure */ + public const FAILURE = self::Failure; + + /** @deprecated use Authenticator::NotApproved */ + public const NOT_APPROVED = self::NotApproved; /** * Performs an authentication. diff --git a/src/Security/Authorizator.php b/src/Security/Authorizator.php index 106f6cb8..a8fa356e 100644 --- a/src/Security/Authorizator.php +++ b/src/Security/Authorizator.php @@ -25,8 +25,13 @@ interface Authorizator /** Permission type: deny */ public const Deny = false; + /** @deprecated use Authorizator::All */ public const ALL = self::All; + + /** @deprecated use Authorizator::Allow */ public const ALLOW = self::Allow; + + /** @deprecated use Authorizator::Deny */ public const DENY = self::Deny; /** diff --git a/src/Security/User.php b/src/Security/User.php index baae406f..96e0a5c2 100644 --- a/src/Security/User.php +++ b/src/Security/User.php @@ -28,19 +28,23 @@ class User { use Nette\SmartObject; - /** @deprecated */ - public const - MANUAL = UserStorage::LOGOUT_MANUAL, - INACTIVITY = UserStorage::LOGOUT_INACTIVITY; - /** Log-out reason */ public const LogoutManual = UserStorage::LogoutManual, LogoutInactivity = UserStorage::LogoutInactivity; + /** @deprecated use User::LogoutManual */ public const LOGOUT_MANUAL = self::LogoutManual; + + /** @deprecated use User::LogoutManual */ + public const MANUAL = self::LogoutManual; + + /** @deprecated use User::LogoutInactivity */ public const LOGOUT_INACTIVITY = self::LogoutInactivity; + /** @deprecated use User::LogoutInactivity */ + public const INACTIVITY = self::LogoutInactivity; + /** default role for unauthenticated user */ public string $guestRole = 'guest'; diff --git a/src/Security/UserStorage.php b/src/Security/UserStorage.php index 1b5e97e3..e4ca9427 100644 --- a/src/Security/UserStorage.php +++ b/src/Security/UserStorage.php @@ -20,7 +20,10 @@ interface UserStorage LogoutManual = 1, LogoutInactivity = 2; + /** @deprecated use User::LogoutManual */ public const LOGOUT_MANUAL = self::LogoutManual; + + /** @deprecated use User::LogoutInactivity */ public const LOGOUT_INACTIVITY = self::LogoutInactivity; /**