invalidMaxButtons()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 1
nc 1
nop 0
dl 0
loc 3
rs 10
c 0
b 0
f 0
1
<?php
2
3
namespace TelegramBot\InlineKeyboardPagination\Exceptions;
4
5
use Exception;
6
7
/**
8
 * Class InlineKeyboardPaginationException
9
 *
10
 * @package TelegramBot\InlineKeyboardPagination
11
 */
12
final class InlineKeyboardPaginationException extends Exception
13
{
14
    public static function invalidMaxButtons(): self
15
    {
16
        return new self('Invalid max buttons, must be between 5 and 8.');
17
    }
18
19
    public static function pageMustBeBetween(int $minPage, int $maxPage): self
20
    {
21
        return new self("Invalid page selected, must be between {$minPage} and {$maxPage}.");
22
    }
23
24
    public static function invalidItemsPerPage(): self
25
    {
26
        return new self('Invalid number of items per page, must be at least 1.');
27
    }
28
29
    public static function noItems(): self
30
    {
31
        return new self('Items list empty.');
32
    }
33
}
34