Completed
Pull Request — master (#22)
by Daryl
02:28
created

Model_Base   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 40
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 4
lcom 1
cbo 1
dl 0
loc 40
ccs 11
cts 11
cp 1
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A _has() 0 11 2
A __call() 0 13 2
1
<?php
2
3
namespace Clubdeuce\WPLib\Components\GoogleMaps;
4
5
/**
6
 * Class Model_Base
7
 * @package Clubdeuce\WPLib\Components\GoogleMaps
8
 */
9
class Model_Base extends \WPLib_Model_Base {
10
11
	/**
12
	 * @param $property
13
	 *
14
	 * @return bool
15
	 */
16 1
	protected function _has( $property ) {
17
18 1
		$has = false;
19
20 1
		if ( isset( $this->{$property} ) ) {
21 1
			$has = true;
22
		}
23
24 1
		return $has;
25
26
	}
27
28
	/**
29
	 * @param string $method_name
30
	 * @param array $args
31
	 *
32
	 * @return null|mixed
33
	 */
34 1
	function __call( $method_name, $args ) {
35
36 1
		$value = null;
37
38 1
		if ( property_exists( $this, "_{$method_name}" ) ) {
39 1
			$property = "_{$method_name}";
40 1
			$value = $this->{$property};
41
42
		}
43
44 1
		return $value;
45
46
	}
47
48
}
49