Info_Window   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 60
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 2
Bugs 0 Features 0
Metric Value
wmc 4
eloc 12
c 2
b 0
f 0
dl 0
loc 60
ccs 13
cts 13
cp 1
rs 10

4 Methods

Rating   Name   Duplication   Size   Complexity  
A set_pixel_offset() 0 3 1
A set_max_width() 0 3 1
A set_content() 0 3 1
A set_position() 0 8 1
1
<?php
2
3
namespace Clubdeuce\WPGoogleMaps;
4
5
/**
6
 * Class Info_Window
7
 * @package Clubdeuce\WPGoogleMaps
8
 *
9
 * @method string content()
10
 * @method int    pixel_offset()
11
 * @method array  position()
12
 * @method int    max_width()
13
 * @link     https://developers.google.com/maps/documentation/javascript/infowindows
14
 */
15
class Info_Window extends Model_Base {
16
17
	/**
18
	 * @var string
19
	 */
20
	protected $_content = '';
21
22
	/**
23
	 * @var int
24
	 */
25
	protected $_pixel_offset = 0;
26
27
	/**
28
	 * @var array
29
	 */
30
	protected $_position;
31
32
	/**
33
	 * @var int
34
	 */
35
	protected $_max_width;
36
37
	/**
38
	 * @param string $content
39
	 */
40 1
	public function set_content( $content ) {
41
42 1
		$this->_content = $content;
43
44 1
	}
45
46
	/**
47
	 * @param int $offset
48
	 */
49 1
	public function set_pixel_offset( $offset ) {
50
51 1
		$this->_pixel_offset = $offset;
52
53 1
	}
54
55
	/**
56
	 * @param array $position
57
	 */
58 2
	public function set_position( $position ) {
59
60 2
		$position = wp_parse_args( $position, array(
61 2
			'lat' => null,
62
			'lng' => null,
63
		) );
64
65 2
		$this->_position = $position;
66
67 2
	}
68
69
	/**
70
	 * @param int $width
71
	 */
72 1
	public function set_max_width( $width ) {
73
74 1
		$this->_max_width = $width;
75
76 1
	}
77
78
}
79