InterwikiLinkNode::toSyntax()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 1
c 1
b 0
f 0
nc 1
nop 0
dl 0
loc 3
rs 10
1
<?php
2
3
namespace dokuwiki\plugin\prosemirror\parser;
4
5
class InterwikiLinkNode extends LinkNode
6
{
7
    public function toSyntax()
8
    {
9
        return $this->getDefaultLinkSyntax($this->attrs['data-inner']);
10
    }
11
12
    public static function render(\renderer_plugin_prosemirror $renderer, $name, $wikiName, $wikiUri)
13
    {
14
        $shortcut = $wikiName;
15
        $url = $renderer->_resolveInterWiki($shortcut, $wikiUri, $exists);
0 ignored issues
show
Comprehensibility Best Practice introduced by
The variable $exists seems to be never defined.
Loading history...
16
        $additionalAttributes = [
17
            'data-resolvedUrl' => $url,
18
            'data-resolvedClass' => 'interwikilink interwiki iw_' . $shortcut,
19
        ];
20
        self::renderToJSON(
21
            $renderer,
22
            'interwikilink',
23
            "$wikiName>$wikiUri",
24
            $name,
25
            $additionalAttributes
26
        );
27
    }
28
}
29