WmsOverlay::setWmsServerUrl()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
dl 0
loc 3
ccs 0
cts 3
cp 0
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 1
crap 2
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