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

MapOutput::addResourcesToParserOutput()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 7

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 5
CRAP Score 2

Importance

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