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

ImageOverlay::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 4
CRAP Score 1

Importance

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