MapOutput   A
last analyzed

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 30
	public function __construct( string $html, array $resourceModules, string $headItems ) {
14 30
		$this->html = $html;
15 30
		$this->resourceModules = $resourceModules;
16 30
		$this->headItems = $headItems;
17 30
	}
18
19 30
	public function getHtml(): string {
20 30
		return $this->html;
21
	}
22
23 3
	public function getHeadItems(): string {
24 3
		return $this->headItems;
25
	}
26
27 3
	public function getResourceModules(): array {
28 3
		return $this->resourceModules;
29
	}
30
31 27
	public function addResourcesToParserOutput( \ParserOutput $po ) {
32 27
		if ( $this->headItems !== '' ) {
33 1
			$po->addHeadItem( $this->headItems );
34
		}
35
36 27
		$po->addModules( $this->resourceModules );
37 27
	}
38
39
}
40