Completed
Push — master ( e0be30...eaeab3 )
by Алексей
05:57
created

KeyboardButtonEntry   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 34
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Importance

Changes 0
Metric Value
wmc 4
lcom 1
cbo 1
dl 0
loc 34
rs 10
c 0
b 0
f 0

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 static
21
     */
22
    public static function create($text = '', $requestContact = false, $requestLocation = false)
23
    {
24
        return (new static())
25
            ->setText($text)
26
            ->setRequestContact($requestContact)
27
            ->setRequestLocation($requestLocation);
28
    }
29
30
    public function setText($text)
31
    {
32
        return $this->set('text', $text);
33
    }
34
35
    /**
36
     * @param bool $requestContact
37
     * @return BaseEntry
38
     */
39
    public function setRequestContact(bool $requestContact)
40
    {
41
        return $this->set('request_contact', $requestContact);
42
    }
43
44
    public function setRequestLocation(bool $requestLocation){
45
        return $this->set('request_contact', $requestLocation);
46
    }
47
}