Completed
Push — master ( a0a91d...2ae44a )
by Daryl
02:10
created

Location_Model::__call()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 10
Code Lines 6

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
c 0
b 0
f 0
dl 0
loc 10
rs 9.4285
cc 2
eloc 6
nc 2
nop 2
1
<?php
2
3
namespace Clubdeuce\WPLib\Components\GoogleMaps;
4
5
/**
6
 * Class Location_Model
7
 * @package Clubdeuce\WPLib\Components\GoogleMaps
8
 * @method  string address()
9
 * @method  string formatted_address()
10
 * @method  float  latitude()
11
 * @method  string location_type()
12
 * @method  float  longitude()
13
 * @method  string place_id()
14
 * @method  array  type()
15
 * @method  array  viewport()
16
 */
17
class Location_Model extends \WPLib_Model_Base {
18
19
    /**
20
     * @var string
21
     */
22
    protected $_address;
23
24
    /**
25
     * @var string
26
     */
27
    protected $_formatted_address;
28
29
    /**
30
     * @var float
31
     */
32
    protected $_latitude;
33
34
    /**
35
     * @var string
36
     */
37
    protected $_location_type;
38
39
    /**
40
     * @var float
41
     */
42
    protected $_longitude;
43
44
    /**
45
     * @var string
46
     */
47
    protected $_place_id;
48
49
    /**
50
     * @var array
51
     */
52
    protected $_viewport = array();
53
54
    /**
55
     * @param  string $method_name
56
     * @return mixed
57
     */
58
    public function __call( $method_name, $args ) {
59
        $value = null;
60
61
        if ( property_exists( $this, "_{$method_name}" ) ) {
62
            $property = "_{$method_name}";
63
            $value = $this->{$property};
64
        }
65
66
        return $value;
67
    }
68
}
69