Completed
Push — nophpunit ( 9a5068 )
by Jeroen De
05:11
created

Polygon::isOnlyVisibleOnHover()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
cc 1
eloc 2
nc 1
nop 0
dl 0
loc 3
ccs 2
cts 2
cp 1
crap 1
rs 10
c 0
b 0
f 0
1
<?php
2
3
namespace Maps\Elements;
4
5
use InvalidArgumentException;
6
7
/**
8
 * @since 3.0
9
 *
10
 * @licence GNU GPL v2+
11
 * @author Kim Eik < [email protected] >
12
 * @author Jeroen De Dauw < [email protected] >
13
 */
14
class Polygon extends Line {
15
16
	private $onlyVisibleOnHover = false;
17
	private $fillOpacity = '0.5';
18
	private $fillColor = '#FF0000';
19
20 3
	public function isOnlyVisibleOnHover(): bool {
21 3
		return $this->onlyVisibleOnHover;
22
	}
23
24 3
	public function setOnlyVisibleOnHover( bool $visible ) {
25 3
		$this->onlyVisibleOnHover = $visible;
26 3
	}
27
28 3
	public function setFillOpacity( string $fillOpacity ) {
29 3
		$this->fillOpacity = $fillOpacity;
30 3
	}
31
32 3
	public function setFillColor( string $fillColor ) {
33 3
		$this->fillColor = $fillColor;
34 3
	}
35
36 6
	public function getJSONObject( string $defText = '', string $defTitle = '' ): array {
37 6
		$json = parent::getJSONObject( $defText, $defTitle );
38
39 6
		$json['onlyVisibleOnHover'] = $this->onlyVisibleOnHover;
40 6
		$json['fillColor'] = $this->fillColor;
41 6
		$json['fillOpacity'] = $this->fillOpacity;
42
43 6
		return $json;
44
	}
45
46
}
47