Completed
Push — master ( 7d37a2...fea370 )
by Nikolay
06:21
created

SendVenueMethod::__construct()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 9
Code Lines 7

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 7
CRAP Score 2.0078

Importance

Changes 0
Metric Value
eloc 7
dl 0
loc 9
ccs 7
cts 8
cp 0.875
rs 10
c 0
b 0
f 0
cc 2
nc 2
nop 6
crap 2.0078
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Greenplugin\TelegramBot\Method;
6
7
use Greenplugin\TelegramBot\Method\Traits\FillFromArrayTrait;
8
use Greenplugin\TelegramBot\Method\Traits\SendToChatVariablesTrait;
9
10
/**
11
 * Class SendVenueMethod.
12
 */
13
class SendVenueMethod
14
{
15
    use FillFromArrayTrait;
16
    use SendToChatVariablesTrait;
17
18
    /**
19
     * Latitude of the venue.
20
     *
21
     * @var float
22
     */
23
    public $latitude;
24
25
    /**
26
     * Longitude of the venue.
27
     *
28
     * @var float
29
     */
30
    public $longitude;
31
32
    /**
33
     * Name of the venue.
34
     *
35
     * @var string
36
     */
37
    public $title;
38
39
    /**
40
     * Address of the venue.
41
     *
42
     * @var string
43
     */
44
    public $address;
45
46
    /**
47
     * Optional. Foursquare identifier of the venue.
48
     *
49
     * @var string|null
50
     */
51
    public $foursquareId;
52
53
    /**
54
     * Optional. Foursquare type of the venue, if known.
55
     * (For example, “arts_entertainment/default”, “arts_entertainment/aquarium” or “food/icecream”.).
56
     *
57
     * @var string|null
58
     */
59
    public $foursquareType;
60
61
    /**
62
     * SendVenueMethod constructor.
63
     *
64
     * @param int|string $chatId
65
     * @param float      $latitude
66
     * @param float      $longitude
67
     * @param string     $title
68
     * @param string     $address
69
     * @param array|null $data
70
     *
71
     * @throws \Greenplugin\TelegramBot\Exception\BadArgumentException
72
     */
73 3
    public function __construct($chatId, float $latitude, float $longitude, string $title, $address, array $data = null)
74
    {
75 3
        $this->chatId = $chatId;
76 3
        $this->latitude = $latitude;
77 3
        $this->longitude = $longitude;
78 3
        $this->title = $title;
79 3
        $this->address = $address;
80 3
        if ($data) {
81
            $this->fill($data);
82
        }
83 3
    }
84
}
85