KeyboardButtonEntry   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 42
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 4
c 0
b 0
f 0
lcom 1
cbo 1
dl 0
loc 42
ccs 11
cts 11
cp 1
rs 10

4 Methods

Rating   Name   Duplication   Size   Complexity  
A create() 0 7 1
A setText() 0 4 1
A setRequestContact() 0 4 1
A setRequestLocation() 0 3 1
1
<?php
2
/**
3
 * Created by PhpStorm.
4
 * User: akeinhell
5
 * Date: 20.11.16
6
 * Time: 20:05
7
 */
8
9
namespace Telegram\Entry;
10
11
12
use Telegram\Base\BaseEntry;
13
14
class KeyboardButtonEntry extends BaseEntry
15
{
16
    /**
17
     * @param $text
18
     * @param bool $requestContact
19
     * @param bool $requestLocation
20
     * @return KeyboardButtonEntry
21
     */
22 1
    public static function create($text = '', $requestContact = false, $requestLocation = false)
23
    {
24 1
        return (new static())
25 1
            ->setText($text)
26 1
            ->setRequestContact($requestContact)
27 1
            ->setRequestLocation($requestLocation);
28
    }
29
30
    /**
31
     * @param $text
32
     * @return $this
33
     */
34 1
    public function setText($text)
35
    {
36 1
        return $this->set('text', $text);
37
    }
38
39
    /**
40
     * @param bool $requestContact
41
     * @return $this
42
     */
43 1
    public function setRequestContact($requestContact)
44
    {
45 1
        return $this->set('request_contact', $requestContact);
46
    }
47
48
    /**
49
     * @param bool $requestLocation
50
     * @return $this
51
     */
52 1
    public function setRequestLocation($requestLocation){
53 1
        return $this->set('request_contact', $requestLocation);
54
    }
55
}