Completed
Push — master ( 4fc976...da1f42 )
by Daryl
01:27
created

Info_Window::set_position()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 10
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 5
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 10
ccs 5
cts 5
cp 1
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 5
nc 1
nop 1
crap 1
1
<?php
2
3
namespace Clubdeuce\WPGoogleMaps;
4
5
/**
6
 * Class Info_Window
7
 * @package Clubdeuce\WPGoogleMaps
8
 */
9
class Info_Window extends Model_Base {
10
11
	/**
12
	 * @var string
13
	 */
14
	protected $_content = '';
15
16
	/**
17
	 * @var int
18
	 */
19
	protected $_pixel_offset = 0;
20
21
	/**
22
	 * @var array
23
	 */
24
	protected $_position;
25
26
	/**
27
	 * @var int
28
	 */
29
	protected $_max_width;
30
31
	/**
32
	 * @param string $content
33
	 */
34 1
	public function set_content( $content ) {
35
36 1
		$this->_content = $content;
37
38 1
	}
39
40
	/**
41
	 * @param string $offset
42
	 */
43 1
	public function set_pixel_offset( $offset ) {
44
45 1
		$this->_pixel_offset = $offset;
0 ignored issues
show
Documentation Bug introduced by
The property $_pixel_offset was declared of type integer, but $offset is of type string. Maybe add a type cast?

This check looks for assignments to scalar types that may be of the wrong type.

To ensure the code behaves as expected, it may be a good idea to add an explicit type cast.

$answer = 42;

$correct = false;

$correct = (bool) $answer;
Loading history...
46
47 1
	}
48
49
	/**
50
	 * @param array $position
51
	 */
52 2
	public function set_position( $position ) {
53
54 2
		$position = wp_parse_args( $position, array(
55 2
			'lat' => null,
56
			'lng' => null,
57
		) );
58
59 2
		$this->_position = $position;
60
61 2
	}
62
63
	/**
64
	 * @param string $width
65
	 */
66 1
	public function set_max_width( $width ) {
67
68 1
		$this->_max_width = $width;
0 ignored issues
show
Documentation Bug introduced by
The property $_max_width was declared of type integer, but $width is of type string. Maybe add a type cast?

This check looks for assignments to scalar types that may be of the wrong type.

To ensure the code behaves as expected, it may be a good idea to add an explicit type cast.

$answer = 42;

$correct = false;

$correct = (bool) $answer;
Loading history...
69
70 1
	}
71
72
}
73