Completed
Push — master ( 7c792b...5c54ea )
by Bryan
01:53
created

City::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 14
Code Lines 10

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 14
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 10
nc 1
nop 5
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
    function __construct(
0 ignored issues
show
Best Practice introduced by
It is generally recommended to explicitly declare the visibility for methods.

Adding explicit visibility (private, protected, or public) is generally recommend to communicate to other developers how, and from where this method is intended to be used.

Loading history...
38
            string $name = null,
39
            string $state = null,
40
            string $country = null,
41
            float $lat = null,
42
            float $lng = null
43
        )
44
    {
45
        $this->name = $name;
46
        $this->state = $state;
47
        $this->country = $country;
48
49
        parent::__construct($lat, $lng);
50
    }
51
}
52