Skip to content

Commit

Permalink
uppercase constants marked as deprecated
Browse files Browse the repository at this point in the history
  • Loading branch information
dg committed Jan 9, 2023
1 parent 79599e2 commit fec10f4
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 14 deletions.
17 changes: 11 additions & 6 deletions src/Security/Authenticator.php
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
6 changes: 5 additions & 1 deletion src/Security/Authorizator.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,13 @@ interface Authorizator
/** Permission type: deny */
public const Deny = false;

/** Deprecated */
/** @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;

/**
Expand Down
15 changes: 9 additions & 6 deletions src/Security/User.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,20 +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 */
/** @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';

Expand Down
4 changes: 3 additions & 1 deletion src/Security/UserStorage.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,10 @@ interface UserStorage
LogoutManual = 1,
LogoutInactivity = 2;

/** Deprecated */
/** @deprecated use User::LogoutManual */
public const LOGOUT_MANUAL = self::LogoutManual;

/** @deprecated use User::LogoutInactivity */
public const LOGOUT_INACTIVITY = self::LogoutInactivity;

/**
Expand Down

0 comments on commit fec10f4

Please sign in to comment.