InlineKeyboardMarkupType::create()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 4
CRAP Score 1

Importance

Changes 0
Metric Value
eloc 3
dl 0
loc 6
ccs 4
cts 4
cp 1
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 1
crap 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace TgBotApi\BotApiBase\Type;
6
7
/**
8
 * Class InlineKeyboardMarkupType
9
 * Note: This will only work in Telegram versions released after 9 April, 2016. O
10
 * Older clients will display unsupported message.
11
 *
12
 * @see https://core.telegram.org/bots/api#inlinekeyboardmarkup
13
 * @see https://core.telegram.org/bots#inline-keyboards-and-on-the-fly-updating
14
 */
15
class InlineKeyboardMarkupType
16
{
17
    /**
18
     * Array of button rows, each represented by an Array of InlineKeyboardButton objects.
19
     *
20
     * @var InlineKeyboardButtonType[][]
21
     */
22
    public $inlineKeyboard;
23
24
    /**
25
     * @param array $inlineKeyboard
26
     *
27
     * @return InlineKeyboardMarkupType
28
     */
29 19
    public static function create(array $inlineKeyboard): InlineKeyboardMarkupType
30
    {
31 19
        $instance = new static();
32 19
        $instance->inlineKeyboard = $inlineKeyboard;
33
34 19
        return $instance;
35
    }
36
}
37