Completed
Push — master ( 4d0076...81538e )
by Jeroen De
26s queued 11s
created

MapOutput   A

Complexity

Total Complexity 6

Size/Duplication

Total Lines 33
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 0

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 6
lcom 1
cbo 0
dl 0
loc 33
ccs 16
cts 16
cp 1
rs 10
c 0
b 0
f 0

5 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 5 1
A getHtml() 0 3 1
A getHeadItems() 0 3 1
A getResourceModules() 0 3 1
A addResourcesToParserOutput() 0 7 2
1
<?php
2
3
declare( strict_types = 1 );
4
5
namespace Maps\Map;
6
7
class MapOutput {
8
9
	private $html;
10
	private $headItems;
11
	private $resourceModules;
12
13 29
	public function __construct( string $html, array $resourceModules, string $headItems ) {
14 29
		$this->html = $html;
15 29
		$this->resourceModules = $resourceModules;
16 29
		$this->headItems = $headItems;
17 29
	}
18
19 29
	public function getHtml(): string {
20 29
		return $this->html;
21
	}
22
23 2
	public function getHeadItems(): string {
24 2
		return $this->headItems;
25
	}
26
27 2
	public function getResourceModules(): array {
28 2
		return $this->resourceModules;
29
	}
30
31 27
	public function addResourcesToParserOutput( \ParserOutput $po ) {
32 27
		if ( $this->headItems !== '' ) {
33 3
			$po->addHeadItem( $this->headItems );
34
		}
35
36 27
		$po->addModules( $this->resourceModules );
37 27
	}
38
39
}
40