GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.
Completed
Push — master ( 7d6815...a97d0f )
by Tobias
04:23
created

Coordinates::toArray()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 4
rs 10
c 0
b 0
f 0
cc 1
eloc 2
nc 1
nop 0
1
<?php
2
3
declare(strict_types=1);
4
5
/*
6
 * This file is part of the Geocoder package.
7
 * For the full copyright and license information, please view the LICENSE
8
 * file that was distributed with this source code.
9
 *
10
 * @license    MIT License
11
 */
12
13
namespace Geocoder\Model;
14
15
use Geocoder\Assert;
16
17
/**
18
 * @author William Durand <[email protected]>
19
 */
20
final class Coordinates
21
{
22
    /**
23
     * @var float
24
     */
25
    private $latitude;
26
27
    /**
28
     * @var float
29
     */
30
    private $longitude;
31
32
    /**
33
     * @param float $latitude
34
     * @param float $longitude
35
     */
36
    public function __construct($latitude, $longitude)
37
    {
38
        Assert::notNull($latitude);
39
        Assert::notNull($longitude);
40
41
        $latitude = (float) $latitude;
42
        $longitude = (float) $longitude;
43
44
        Assert::latitude($latitude);
45
        Assert::longitude($longitude);
46
47
        $this->latitude = $latitude;
48
        $this->longitude = $longitude;
49
    }
50
51
    /**
52
     * Returns the latitude.
53
     *
54
     * @return float
55
     */
56
    public function getLatitude(): float
57
    {
58
        return $this->latitude;
59
    }
60
61
    /**
62
     * Returns the longitude.
63
     *
64
     * @return float
65
     */
66
    public function getLongitude(): float
67
    {
68
        return $this->longitude;
69
    }
70
71
    /**
72
     * Returns the coordinates as a tuple
73
     *
74
     * @return array
75
     */
76
    public function toArray(): array
77
    {
78
        return [$this->getLongitude(), $this->getLatitude()];
79
    }
80
}
81