Failed Conditions
Push — psr2 ( e9eace...d4d8fb )
by Andreas
14:17 queued 07:54
created

Footnote   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 46
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 2

Importance

Changes 0
Metric Value
dl 0
loc 46
rs 10
c 0
b 0
f 0
wmc 4
lcom 1
cbo 2

4 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 14 1
A connectTo() 0 8 1
A postConnect() 0 7 1
A getSort() 0 4 1
1
<?php
2
3
namespace dokuwiki\Parsing\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