mirror of
https://github.com/Part-DB/Part-DB-server.git
synced 2026-01-05 01:39:33 +00:00
Fixed some deprecations.
This commit is contained in:
parent
4fa8eef1bf
commit
5fd608f42a
59 changed files with 202 additions and 165 deletions
|
|
@ -55,9 +55,9 @@ class PermissionVoter extends ExtendedVoter
|
|||
* Similar to voteOnAttribute, but checking for the anonymous user is already done.
|
||||
* The current user (or the anonymous user) is passed by $user.
|
||||
*
|
||||
* @param string $attribute
|
||||
* @param string $attribute
|
||||
*/
|
||||
protected function voteOnUser($attribute, $subject, User $user): bool
|
||||
protected function voteOnUser(string $attribute, $subject, User $user): bool
|
||||
{
|
||||
$attribute = ltrim($attribute, '@');
|
||||
[$perm, $op] = explode('.', $attribute);
|
||||
|
|
@ -68,12 +68,12 @@ class PermissionVoter extends ExtendedVoter
|
|||
/**
|
||||
* Determines if the attribute and subject are supported by this voter.
|
||||
*
|
||||
* @param string $attribute An attribute
|
||||
* @param string $attribute An attribute
|
||||
* @param mixed $subject The subject to secure, e.g. an object the user wants to access or any other PHP type
|
||||
*
|
||||
* @return bool True if the attribute and subject are supported, false otherwise
|
||||
*/
|
||||
protected function supports($attribute, $subject)
|
||||
protected function supports(string $attribute, $subject): bool
|
||||
{
|
||||
//Check if the attribute has the form @permission.operation
|
||||
if (preg_match('#^@\\w+\\.\\w+$#', $attribute)) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue