Fix larastan issues

This commit is contained in:
Bubka 2024-06-27 13:37:15 +02:00
parent 0ce5db371f
commit 71bc378212
3 changed files with 9 additions and 6 deletions

View File

@ -62,7 +62,7 @@ public function deleting(User $user) : bool
// Deleting user's twofaccounts icon
$iconPathes = $user->twofaccounts->filter(function ($twofaccount, $key) {
return $twofaccount->icon;
return filled($twofaccount->icon);
})->map(function ($twofaccount, $key) {
return $twofaccount->icon;
});

View File

@ -45,10 +45,10 @@ public static function assign($ids, User $user, ?Group $group = null) : void
/**
* Prepends the pseudo group named 'All' to a group collection
*
* @param Collection<int, Group> $groups
* @return Collection<int, Group>
* @param \Illuminate\Database\Eloquent\Collection<int, Group> $groups
* @return \Illuminate\Database\Eloquent\Collection<int, Group>
*/
public static function prependTheAllGroup(Collection $groups, User $user) : Collection
public static function prependTheAllGroup(Collection $groups, User $user)
{
$theAllGroup = new Group([
'name' => __('commons.all'),
@ -63,7 +63,7 @@ public static function prependTheAllGroup(Collection $groups, User $user) : Coll
/**
* Set owner of given groups
*
* @param Collection<int, Group> $groups
* @param \Illuminate\Database\Eloquent\Collection<int, Group> $groups
*/
public static function setUser(Collection $groups, User $user) : void
{

View File

@ -14,6 +14,7 @@
use Illuminate\Support\Facades\Log;
use Illuminate\Support\Str;
use ParagonIE\ConstantTime\Base32;
use TypeError;
class GoogleAuthMigrator extends Migrator
{
@ -76,8 +77,10 @@ public function migrate(mixed $migrationPayload) : Collection
/**
* Encode into uppercase Base32
*
* @throws TypeError
*/
protected function toBase32(string $str)
protected function toBase32(string $str) : string
{
return Base32::encodeUpper($str);
}