Completed
Pull Request — master (#99)
by Christian
02:26
created

Location::__construct()   A

Complexity

Conditions 3
Paths 4

Size

Total Lines 5
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
dl 0
loc 5
rs 9.4285
c 1
b 0
f 0
cc 3
eloc 3
nc 4
nop 2
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  $lat The latitude of the city.
39
     * @param float  $lon The longitude of the city.
40
     *
41
     * @internal
42
     */
43
    public function __construct($lat = null, $lon = null)
44
    {
45
        $this->lat = isset($lat) ? (float)$lat : null;
46
        $this->lon = isset($lon) ? (float)$lon : null;
47
    }
48
}
49