ImageOverlay::getImage()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 3
ccs 2
cts 2
cp 1
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 0
crap 1
1
<?php
2
3
declare( strict_types = 1 );
4
5
namespace Maps\LegacyModel;
6
7
use DataValues\Geo\Values\LatLongValue;
8
9
/**
10
 * @since 3.0
11
 *
12
 * @licence GNU GPL v2+
13
 * @author Kim Eik < [email protected] >
14
 * @author Jeroen De Dauw < [email protected] >
15
 */
16
class ImageOverlay extends Rectangle {
17
18
	private $imageUrl;
19
20 3
	public function __construct( LatLongValue $boundsNorthEast, LatLongValue $boundsSouthWest, string $image ) {
21 3
		parent::__construct( $boundsNorthEast, $boundsSouthWest );
22
23 3
		$this->imageUrl = $image;
24 3
	}
25
26 2
	public function getImage(): string {
27 2
		return $this->imageUrl;
28
	}
29
30
	public function getJSONObject( string $defText = '', string $defTitle = '' ): array {
31
		$data = parent::getJSONObject( $defText, $defTitle );
32
33
		$data['image'] = $this->imageUrl;
34
35
		return $data;
36
	}
37
38
}
39