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

Coordinates   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 31
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 0

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 2
lcom 1
cbo 0
dl 0
loc 31
ccs 8
cts 8
cp 1
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 5 1
A toArray() 0 7 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