mirror of
https://github.com/Part-DB/Part-DB-server.git
synced 2025-12-19 17:39:31 +00:00
Fixed further inspection issues
This commit is contained in:
parent
33e36f3d2b
commit
87533b6031
37 changed files with 46 additions and 71 deletions
|
|
@ -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;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue