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

Location::__construct()   A

Complexity

Conditions 3
Paths 4

Size

Total Lines 5
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 4
CRAP Score 3

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 3
eloc 3
nc 4
nop 2
crap 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