Controller_Base   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 32
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 3
eloc 11
c 1
b 0
f 0
dl 0
loc 32
ccs 8
cts 8
cp 1
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A __call() 0 14 3
1
<?php
2
3
namespace Clubdeuce\WPGoogleMaps;
4
5
/**
6
 * Class Controller_Base
7
 * @package Clubdeuce\WPGoogleMaps
8
 */
9
class Controller_Base {
10
11
	/**
12
	 * @var Model_Base
13
	 */
14
	protected $_model;
15
16
	/**
17
	 * @var object
18
	 */
19
	protected $_view;
20
21
	/**
22
	 * @param  string $method
23
	 * @param  array  $args
24
	 *
25
	 * @return mixed|null
26
	 */
27 4
	function __call( $method, $args ) {
28
29 4
		$value = null;
30
31
		do {
32 4
			if ( method_exists( $this->_view, $method ) ) {
33 1
				$value = call_user_func_array( array( $this->_view, $method ), $args );
34 1
				break;
35
			}
36
37 4
			$value = call_user_func_array( array( $this->_model, $method ), $args );
38 4
		} while ( false );
39
40 4
		return $value;
41
42
	}
43
44
}
45