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

KeyboardButtonEntry::create()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 7
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 7
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 5
nc 1
nop 3
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
}