Dice   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 47
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 7
dl 0
loc 47
rs 10
c 0
b 0
f 0
wmc 4

4 Methods

Rating   Name   Duplication   Size   Complexity  
A getValue() 0 3 1
A setValue() 0 3 1
A getEmoji() 0 3 1
A setEmoji() 0 3 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Zanzara\Telegram\Type\Miscellaneous;
6
7
/**
8
 * This object represents a dice with random value from 1 to 6. (Yes, we're aware of the "proper" singular of die. But
9
 * it's awkward, and we decided to help it change. One dice at a time!)
10
 *
11
 * More on https://core.telegram.org/bots/api#dice
12
 */
13
class Dice
14
{
15
16
    /**
17
     * Value of the dice, 1-6 for “🎲” and “🎯” base emoji, 1-5 for “🏀” base emoji
18
     *
19
     * @var int
20
     */
21
    private $value;
22
23
    /**
24
     * Emoji on which the dice throw animation is based.
25
     *
26
     * @var string
27
     */
28
    private $emoji;
29
30
    /**
31
     * @return int
32
     */
33
    public function getValue(): int
34
    {
35
        return $this->value;
36
    }
37
38
    /**
39
     * @param int $value
40
     */
41
    public function setValue(int $value): void
42
    {
43
        $this->value = $value;
44
    }
45
46
    /**
47
     * @return string
48
     */
49
    public function getEmoji(): string
50
    {
51
        return $this->emoji;
52
    }
53
54
    /**
55
     * @param string $emoji
56
     */
57
    public function setEmoji(string $emoji): void
58
    {
59
        $this->emoji = $emoji;
60
    }
61
62
}