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.

Bounds   A
last analyzed

Complexity

Total Complexity 6

Size/Duplication

Total Lines 106
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Importance

Changes 0
Metric Value
wmc 6
lcom 1
cbo 1
dl 0
loc 106
rs 10
c 0
b 0
f 0

6 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 22 1
A getSouth() 0 4 1
A getWest() 0 4 1
A getNorth() 0 4 1
A getEast() 0 4 1
A toArray() 0 9 1
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 Bounds
21
{
22
    /**
23
     * @var float
24
     */
25
    private $south;
26
27
    /**
28
     * @var float
29
     */
30
    private $west;
31
32
    /**
33
     * @var float
34
     */
35
    private $north;
36
37
    /**
38
     * @var float
39
     */
40
    private $east;
41
42
    /**
43
     * @param float $south
44
     * @param float $west
45
     * @param float $north
46
     * @param float $east
47
     */
48
    public function __construct($south, $west, $north, $east)
49
    {
50
        Assert::notNull($south);
51
        Assert::notNull($west);
52
        Assert::notNull($north);
53
        Assert::notNull($east);
54
55
        $south = (float) $south;
56
        $north = (float) $north;
57
        $west = (float) $west;
58
        $east = (float) $east;
59
60
        Assert::latitude($south);
61
        Assert::latitude($north);
62
        Assert::longitude($west);
63
        Assert::longitude($east);
64
65
        $this->south = $south;
66
        $this->west = $west;
67
        $this->north = $north;
68
        $this->east = $east;
69
    }
70
71
    /**
72
     * Returns the south bound.
73
     *
74
     * @return float
75
     */
76
    public function getSouth(): float
77
    {
78
        return $this->south;
79
    }
80
81
    /**
82
     * Returns the west bound.
83
     *
84
     * @return float
85
     */
86
    public function getWest(): float
87
    {
88
        return $this->west;
89
    }
90
91
    /**
92
     * Returns the north bound.
93
     *
94
     * @return float
95
     */
96
    public function getNorth(): float
97
    {
98
        return $this->north;
99
    }
100
101
    /**
102
     * Returns the east bound.
103
     *
104
     * @return float
105
     */
106
    public function getEast(): float
107
    {
108
        return $this->east;
109
    }
110
111
    /**
112
     * Returns an array with bounds.
113
     *
114
     * @return array
115
     */
116
    public function toArray(): array
117
    {
118
        return [
119
            'south' => $this->getSouth(),
120
            'west' => $this->getWest(),
121
            'north' => $this->getNorth(),
122
            'east' => $this->getEast(),
123
        ];
124
    }
125
}
126