Completed
Push — master ( 257c19...712c83 )
by Rémi
04:23
created

Coordinates::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 4
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 5
ccs 4
cts 4
cp 1
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 3
nc 1
nop 2
crap 1
1
<?php
2
3
namespace Twitter\API\REST\DTO;
4
5
use Twitter\API\REST\ApiParameters;
6
7
class Coordinates implements ApiParameters
8
{
9
    /** @var float */
10
    private $lat;
11
12
    /** @var float */
13
    private $long;
14
15
    /**
16
     * Coordinates constructor.
17
     *
18
     * @param float $lat
19
     * @param float $long
20
     */
21 9
    public function __construct($lat, $long)
22
    {
23 9
        $this->lat = $lat;
24 9
        $this->long = $long;
25 9
    }
26
27
    /**
28
     * @return array
29
     */
30 9
    public function toArray()
31
    {
32
        return [
33 9
            'lat' => $this->lat,
34 9
            'long' => $this->long,
35 6
        ];
36
    }
37
}
38