Completed
Push — uv-index ( 9af66d )
by Christian
02:24
created

Location   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 26
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 3
lcom 0
cbo 0
dl 0
loc 26
ccs 4
cts 4
cp 1
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 5 3
1
<?php
2
/**
3
 * OpenWeatherMap-PHP-API — A php api to parse weather data from http://www.OpenWeatherMap.org .
4
 *
5
 * @license MIT
6
 *
7
 * Please see the LICENSE file distributed with this source code for further
8
 * information regarding copyright and licensing.
9
 *
10
 * Please visit the following links to read about the usage policies and the license of
11
 * OpenWeatherMap before using this class:
12
 *
13
 * @see http://www.OpenWeatherMap.org
14
 * @see http://www.OpenWeatherMap.org/terms
15
 * @see http://openweathermap.org/appid
16
 */
17
18
namespace Cmfcmf\OpenWeatherMap\Util;
19
20
/**
21
 * The city class representing a city object.
22
 */
23
class Location
24
{
25
    /**
26
     * @var float The latitude of the city.
27
     */
28
    public $lat;
29
30
    /**
31
     * @var float The longitude of the city.
32
     */
33
    public $lon;
34
35
    /**
36
     * Create a new location object.
37
     *
38
     * @param float  $lon        The longitude of the city.
39
     * @param float  $lat        The latitude of the city.
40
     *
41
     * @internal
42
     */
43 21
    public function __construct($lon = null, $lat = null)
44
    {
45 21
        $this->lon = isset($lon) ? (float)$lon : null;
46 21
        $this->lat = isset($lat) ? (float)$lat : null;
47 21
    }
48
}
49