Completed
Push — master ( ee500e...edab47 )
by Steven
01:04
created

Position::isEmpty()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 8

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 8
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 0
1
<?php
2
3
namespace Stevebauman\Location;
4
5
class Position
6
{
7
    /**
8
     * The country name.
9
     *
10
     * @var string|null
11
     */
12
    public $countryName;
13
14
    /**
15
     * The country code.
16
     *
17
     * @var string|null
18
     */
19
    public $countryCode;
20
21
    /**
22
     * The region code.
23
     *
24
     * @var string|null
25
     */
26
    public $regionCode;
27
28
    /**
29
     * The region name.
30
     *
31
     * @var string|null
32
     */
33
    public $regionName;
34
35
    /**
36
     * The city name.
37
     *
38
     * @var string|null
39
     */
40
    public $cityName;
41
42
    /**
43
     * The zip code.
44
     *
45
     * @var string|null
46
     */
47
    public $zipCode;
48
49
    /**
50
     * The iso code.
51
     *
52
     * @var string|null
53
     */
54
    public $isoCode;
55
56
    /**
57
     * The postal code.
58
     *
59
     * @var string|null
60
     */
61
    public $postalCode;
62
63
    /**
64
     * The latitude.
65
     *
66
     * @var string|null
67
     */
68
    public $latitude;
69
70
    /**
71
     * The longitude.
72
     *
73
     * @var string|null
74
     */
75
    public $longitude;
76
77
    /**
78
     * The metro code.
79
     *
80
     * @var string|null
81
     */
82
    public $metroCode;
83
84
    /**
85
     * The area code.
86
     *
87
     * @var string|null
88
     */
89
    public $areaCode;
90
91
    /**
92
     * The driver used for retrieving the location.
93
     *
94
     * @var string|null
95
     */
96
    public $driver;
97
98
    /**
99
     * Determine if the position is empty.
100
     *
101
     * @return bool
102
     */
103
    public function isEmpty()
104
    {
105
        $data = get_object_vars($this);
106
107
        unset($data['driver']);
108
109
        return count(array_filter($data)) === 0;
110
    }
111
}
112