Code Coverage
 
Lines
Functions and Methods
Classes and Traits
Total
0.00% covered (danger)
0.00%
0 / 1
0.00% covered (danger)
0.00%
0 / 1
CRAP
0.00% covered (danger)
0.00%
0 / 1
ParsoidKartographerConfig
0.00% covered (danger)
0.00%
0 / 1
0.00% covered (danger)
0.00%
0 / 1
12
0.00% covered (danger)
0.00%
0 / 1
 __construct
0.00% covered (danger)
0.00%
0 / 1
0.00% covered (danger)
0.00%
0 / 1
2
 getConfig
n/a
0 / 0
n/a
0 / 0
2
1<?php
2
3namespace Kartographer\Tag;
4
5use MediaWiki\Config\Config;
6use Wikimedia\Parsoid\Ext\ExtensionModule;
7
8/**
9 * @license MIT
10 */
11class ParsoidKartographerConfig implements ExtensionModule {
12
13    private Config $config;
14
15    public function __construct(
16        Config $config
17    ) {
18        $this->config = $config;
19    }
20
21    /**
22     * @inheritDoc
23     * @codeCoverageIgnore
24     */
25    public function getConfig(): array {
26        if ( $this->config->get( 'KartographerParsoidSupport' ) ) {
27            return [
28                'name' => 'Kartographer',
29                'tags' => [
30                    [
31                        'name' => 'maplink',
32                        'handler' => ParsoidMapLink::class,
33                        'options' => [
34                            'outputHasCoreMwDomSpecMarkup' => true,
35                            'wt2html' => [
36                                'embedsHTMLInAttributes' => true
37                            ]
38                        ],
39                    ],
40                    [
41                        'name' => 'mapframe',
42                        'handler' => [
43                            'class' => ParsoidMapFrame::class,
44                            'services' => [
45                                'MainConfig'
46                            ],
47                        ],
48                        'options' => [
49                            'outputHasCoreMwDomSpecMarkup' => true,
50                            'wt2html' => [
51                                'embedsHTMLInAttributes' => true
52                            ]
53                        ],
54                    ]
55                ],
56                'domProcessors' => [ [
57                    'class' => ParsoidDomProcessor::class,
58                    'services' => [
59                        'MainConfig',
60                    ] ],
61                ],
62            ];
63        } else {
64            return [
65                'name' => 'Kartographer',
66            ];
67        }
68    }
69}