Failed Conditions
Push — psr2 ( de3699...36dc94 )
by Andreas
06:50 queued 03:31
created

Preformatted   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 27
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 2

Importance

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

3 Methods

Rating   Name   Duplication   Size   Complexity  
A connectTo() 0 10 1
A postConnect() 0 4 1
A getSort() 0 4 1
1
<?php
2
3
namespace dokuwiki\ParserMode;
4
5
class Preformatted extends AbstractMode
6
{
7
8
    /** @inheritdoc */
9
    public function connectTo($mode)
10
    {
11
        // Has hard coded awareness of lists...
12
        $this->Lexer->addEntryPattern('\n  (?![\*\-])', $mode, 'preformatted');
13
        $this->Lexer->addEntryPattern('\n\t(?![\*\-])', $mode, 'preformatted');
14
15
        // How to effect a sub pattern with the Lexer!
16
        $this->Lexer->addPattern('\n  ', 'preformatted');
17
        $this->Lexer->addPattern('\n\t', 'preformatted');
18
    }
19
20
    /** @inheritdoc */
21
    public function postConnect()
22
    {
23
        $this->Lexer->addExitPattern('\n', 'preformatted');
24
    }
25
26
    /** @inheritdoc */
27
    public function getSort()
28
    {
29
        return 20;
30
    }
31
}
32