InlineKeyboardPaginationException   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 20
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 5
dl 0
loc 20
rs 10
c 1
b 0
f 0
wmc 4

4 Methods

Rating   Name   Duplication   Size   Complexity  
A pageMustBeBetween() 0 3 1
A invalidMaxButtons() 0 3 1
A noItems() 0 3 1
A invalidItemsPerPage() 0 3 1
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