| Conditions | 2 |
| Paths | 2 |
| Total Lines | 11 |
| Code Lines | 7 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 17 | public function applyOn(int|string $chatId, ?int $userId = null, ?int $untilDate = null): ?PromiseInterface |
||
| 18 | { |
||
| 19 | /** @var \Sysbot\Telegram\Types\ChatPermissions $this */ |
||
| 20 | if (empty($userId)) { |
||
| 21 | return $this->api?->setChatPermissions(chatId: $chatId, permissions: $this); |
||
| 22 | } |
||
| 23 | return $this->api?->restrictChatMember( |
||
| 24 | chatId: $chatId, |
||
| 25 | userId: $userId, |
||
| 26 | permissions: $this, |
||
| 27 | untilDate: $untilDate |
||
| 28 | ); |
||
| 31 | } |