WmsOverlay   A
last analyzed

Complexity

Total Complexity 8

Size/Duplication

Total Lines 59
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
wmc 8
lcom 1
cbo 1
dl 0
loc 59
ccs 0
cts 26
cp 0
rs 10
c 0
b 0
f 0

8 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 5 1
A getJSONObject() 0 10 1
A getWmsServerUrl() 0 3 1
A setWmsServerUrl() 0 3 1
A getWmsLayerName() 0 3 1
A setWmsLayerName() 0 3 1
A getWmsStyleName() 0 3 1
A setWmsStyleName() 0 3 1
1
<?php
2
3
declare( strict_types = 1 );
4
5
namespace Maps\LegacyModel;
6
7
/**
8
 * Class that holds metadata on WMS overlay layers on map
9
 *
10
 * @since 3.0
11
 *
12
 * @licence GNU GPL v2+
13
 * @author Mathias Lidal < [email protected] >
14
 */
15
class WmsOverlay extends BaseElement {
16
17
	/**
18
	 * @var String Base url to WMS server
19
	 */
20
	private $wmsServerUrl;
21
22
	/**
23
	 * @var String WMS Layer name
24
	 */
25
	private $wmsLayerName;
26
27
	/**
28
	 * @var String WMS Style name (default value: 'default')
29
	 */
30
	private $wmsStyleName;
31
32
	public function __construct( string $wmsServerUrl, string $wmsLayerName, string $wmsStyleName = "default" ) {
33
		$this->setWmsServerUrl( $wmsServerUrl );
34
		$this->setWmsLayerName( $wmsLayerName );
35
		$this->setWmsStyleName( $wmsStyleName );
36
	}
37
38
	public function getJSONObject( string $defText = '', string $defTitle = '' ): array {
39
		$parentArray = parent::getJSONObject( $defText, $defTitle );
0 ignored issues
show
Deprecated Code introduced by
The method Maps\LegacyModel\BaseElement::getJSONObject() has been deprecated.

This method has been deprecated.

Loading history...
40
41
		$array = [
42
			'wmsServerUrl' => $this->getWmsServerUrl(),
43
			'wmsLayerName' => $this->getWmsLayerName(),
44
			'wmsStyleName' => $this->getWmsStyleName()
45
		];
46
		return array_merge( $parentArray, $array );
47
	}
48
49
	public function getWmsServerUrl(): string {
50
		return $this->wmsServerUrl;
51
	}
52
53
	public function setWmsServerUrl( string $wmsServerUrl ) {
54
		$this->wmsServerUrl = $wmsServerUrl;
55
	}
56
57
	public function getWmsLayerName(): string {
58
		return $this->wmsLayerName;
59
	}
60
61
	public function setWmsLayerName( string $wmsLayerName ) {
62
		$this->wmsLayerName = $wmsLayerName;
63
	}
64
65
	public function getWmsStyleName(): string {
66
		return $this->wmsStyleName;
67
	}
68
69
	public function setWmsStyleName( string $wmsStyleName ) {
70
		$this->wmsStyleName = $wmsStyleName;
71
	}
72
73
}
74