Skip to content

Commit

Permalink
phpstan fix
Browse files Browse the repository at this point in the history
  • Loading branch information
fabio-ivona committed Feb 6, 2023
1 parent 4adec4c commit 6611270
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
1 change: 1 addition & 0 deletions phpstan.neon
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ parameters:

ignoreErrors:
- '#expects string, array\|string\|null given#'
- '#expects string, mixed given#'

checkMissingIterableValueType: true
checkGenericClassInNonGenericObjectType: false
Expand Down
4 changes: 3 additions & 1 deletion src/Concerns/HasBotsAndChats.php
Original file line number Diff line number Diff line change
Expand Up @@ -514,8 +514,10 @@ public function demoteChatMember(string $userId): Telegraph
$telegraph->data['chat_id'] = $telegraph->getChatId();
$telegraph->data['user_id'] = $userId;

/** @var array<string|bool> $permissions */
$permissions = collect(ChatAdminPermissions::available_permissions())
->mapWithKeys(fn ($value) => [$value => false]);
->mapWithKeys(fn (string $value) => [$value => false])
->toArray();

foreach ($permissions as $permission => $enabled) {
$telegraph->data[$permission] = $enabled;
Expand Down

0 comments on commit 6611270

Please sign in to comment.