Fixed further inspection issues

This commit is contained in:
Jan Böhmer 2024-03-03 20:33:24 +01:00
parent 33e36f3d2b
commit 87533b6031
37 changed files with 46 additions and 71 deletions

View file

@ -135,7 +135,7 @@ final class AttachmentVoter extends Voter
*
* @return bool True if the attribute and subject are supported, false otherwise
*/
protected function supports(string $attribute, $subject): bool
protected function supports(string $attribute, mixed $subject): bool
{
if (is_a($subject, Attachment::class, true)) {
//These are the allowed attributes

View file

@ -57,7 +57,7 @@ final class GroupVoter extends Voter
*
* @return bool True if the attribute and subject are supported, false otherwise
*/
protected function supports(string $attribute, $subject): bool
protected function supports(string $attribute, mixed $subject): bool
{
if (is_a($subject, Group::class, true)) {
return $this->helper->isValidOperation('groups', $attribute);

View file

@ -62,7 +62,7 @@ final class PermissionVoter extends Voter
*
* @return bool True if the attribute and subject are supported, false otherwise
*/
protected function supports(string $attribute, $subject): bool
protected function supports(string $attribute, mixed $subject): bool
{
//Check if the attribute has the form @permission.operation
if (preg_match('#^@\\w+\\.\\w+$#', $attribute)) {

View file

@ -68,7 +68,7 @@ final class StructureVoter extends Voter
*
* @return bool True if the attribute and subject are supported, false otherwise
*/
protected function supports(string $attribute, $subject): bool
protected function supports(string $attribute, mixed $subject): bool
{
if (is_object($subject) || is_string($subject)) {
$permission_name = $this->instanceToPermissionName($subject);
@ -87,11 +87,11 @@ final class StructureVoter extends Voter
/**
* Maps an instance type to the permission name.
*
* @param object|string $subject The subject for which the permission name should be generated
* @param object|string $subject The subject for which the permission name should be generated
*
* @return string|null the name of the permission for the subject's type or null, if the subject is not supported
*/
protected function instanceToPermissionName($subject): ?string
protected function instanceToPermissionName(object|string $subject): ?string
{
$class_name = is_string($subject) ? $subject : $subject::class;

View file

@ -47,7 +47,7 @@ final class UserVoter extends Voter
*
* @return bool True if the attribute and subject are supported, false otherwise
*/
protected function supports(string $attribute, $subject): bool
protected function supports(string $attribute, mixed $subject): bool
{
if (is_a($subject, User::class, true)) {
return in_array($attribute,