Conditions | 3 |
Paths | 4 |
Total Lines | 30 |
Lines | 0 |
Ratio | 0 % |
Tests | 18 |
CRAP Score | 3 |
Changes | 0 |
1 | <?php |
||
12 | 29 | public function getMapHTML( array $json, string $mapId, string $serviceName ): string { |
|
13 | 29 | if ( is_int( $json['height'] ) ) { |
|
14 | 29 | $json['height'] = (string)$json['height'] . 'px'; |
|
15 | } |
||
16 | |||
17 | 29 | if ( is_int( $json['width'] ) ) { |
|
18 | 1 | $json['width'] = (string)$json['width'] . 'px'; |
|
19 | } |
||
20 | |||
21 | 29 | return Html::rawElement( |
|
22 | 29 | 'div', |
|
23 | [ |
||
24 | 29 | 'id' => $mapId, |
|
25 | 29 | 'style' => "width: {$json['width']}; height: {$json['height']}; background-color: #eeeeee; overflow: hidden;", |
|
26 | 29 | 'class' => 'maps-map maps-' . $serviceName |
|
27 | ], |
||
28 | 29 | Html::element( |
|
29 | 29 | 'div', |
|
30 | [ |
||
31 | 29 | 'class' => 'maps-loading-message' |
|
32 | ], |
||
33 | 29 | wfMessage( 'maps-loading-map' )->inContentLanguage()->text() |
|
34 | ) |
||
35 | 29 | . Html::element( |
|
36 | 29 | 'div', |
|
37 | 29 | [ 'style' => 'display:none', 'class' => 'mapdata' ], |
|
38 | 29 | FormatJson::encode( $json ) |
|
39 | ) |
||
40 | ); |
||
41 | } |
||
42 | |||
44 |