Failed Conditions
Push — psr2 ( de3699...36dc94 )
by Andreas
03:29
created

Footnote::getSort()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
nc 1
dl 0
loc 4
c 0
b 0
f 0
cc 1
eloc 2
nop 0
rs 10
1
<?php
2
3
namespace dokuwiki\ParserMode;
4
5
class Footnote extends AbstractMode
6
{
7
8
    /**
9
     * Footnote constructor.
10
     */
11
    public function __construct()
12
    {
13
        global $PARSER_MODES;
14
15
        $this->allowedModes = array_merge(
16
            $PARSER_MODES['container'],
17
            $PARSER_MODES['formatting'],
18
            $PARSER_MODES['substition'],
19
            $PARSER_MODES['protected'],
20
            $PARSER_MODES['disabled']
21
        );
22
23
        unset($this->allowedModes[array_search('footnote', $this->allowedModes)]);
24
    }
25
26
    /** @inheritdoc */
27
    public function connectTo($mode)
28
    {
29
        $this->Lexer->addEntryPattern(
30
            '\x28\x28(?=.*\x29\x29)',
31
            $mode,
32
            'footnote'
33
        );
34
    }
35
36
    /** @inheritdoc */
37
    public function postConnect()
38
    {
39
        $this->Lexer->addExitPattern(
40
            '\x29\x29',
41
            'footnote'
42
        );
43
    }
44
45
    /** @inheritdoc */
46
    public function getSort()
47
    {
48
        return 150;
49
    }
50
}
51