Fix phpstan error courtesy of the laravel 11 upgrade (changed signatures and return types)

This commit is contained in:
James Cole
2024-04-02 15:40:33 +02:00
parent 87911c2438
commit a17bc7258f
73 changed files with 2772 additions and 2827 deletions

View File

@@ -89,6 +89,17 @@ class Preferences
return $this->setForUser($user, $name, $default);
}
private function getUserGroupId(User $user, string $preferenceName): ?int
{
$groupId = null;
$items = config('firefly.admin_specific_prefs') ?? [];
if (in_array($preferenceName, $items, true)) {
$groupId = (int)$user->user_group_id;
}
return $groupId;
}
public function delete(string $name): bool
{
$fullName = sprintf('preference%s%s', auth()->user()->id, $name);
@@ -215,7 +226,7 @@ class Preferences
public function set(string $name, null|array|bool|int|string $value): Preference
{
/** @var User $user */
/** @var null|User $user */
$user = auth()->user();
if (null === $user) {
// make new preference, return it:
@@ -228,15 +239,4 @@ class Preferences
return $this->setForUser($user, $name, $value);
}
private function getUserGroupId(User $user, string $preferenceName): ?int
{
$groupId = null;
$items = config('firefly.admin_specific_prefs') ?? [];
if (in_array($preferenceName, $items, true)) {
$groupId = (int)$user->user_group_id;
}
return $groupId;
}
}