City::__construct()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 14
Code Lines 10

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 6
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 14
ccs 6
cts 6
cp 1
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 10
nc 1
nop 5
crap 1
1
<?php
2
namespace Bhhaskin\WeatherBee\Util;
3
4
use Bhhaskin\WeatherBee\Util\Location;
5
6
/**
7
 * Class for handling city
8
 */
9
class City extends Location
10
{
11
    /**
12
     * Name of the city.
13
     * @var string
14
     */
15
    public $name;
16
17
    /**
18
     * Name of the state the city is in.
19
     * @var string
20
     */
21
    public $state;
22
23
    /**
24
     * Name of the country the city is in.
25
     * @var [type]
26
     */
27
    public $country;
28
29
    /**
30
     * Creates city object.
31
     * @param string $name    Name of the city.
32
     * @param string $state   Name of state the city is in.
33
     * @param string $country Name of the country the city is in.
34
     * @param float  $lat     Latitude of city.
35
     * @param float  $lng     Longitude of city,
36
     */
37 1
    public function __construct(
38
            string $name = null,
39
            string $state = null,
40
            string $country = null,
41
            float $lat = null,
42
            float $lng = null
43
        )
44
    {
45 1
        $this->name = $name;
46 1
        $this->state = $state;
47 1
        $this->country = $country;
48
49 1
        parent::__construct($lat, $lng);
50 1
    }
51
}
52