Failed Conditions
Push — psr2-config ( c6639e )
by Andreas
06:39 queued 03:33
created

AbstractMode   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 30
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

Changes 0
Metric Value
dl 0
loc 30
rs 10
c 0
b 0
f 0
wmc 4
lcom 0
cbo 0

5 Methods

Rating   Name   Duplication   Size   Complexity  
getSort() 0 1 ?
A preConnect() 0 3 1
A connectTo() 0 3 1
A postConnect() 0 3 1
A accepts() 0 4 1
1
<?php
2
3
namespace dokuwiki\Parsing\ParserMode;
4
5
/**
6
 * This class and all the subclasses below are used to reduce the effort required to register
7
 * modes with the Lexer.
8
 *
9
 * @author Harry Fuecks <[email protected]>
10
 */
11
abstract class AbstractMode implements ModeInterface
12
{
13
    /** @var \dokuwiki\Parsing\Lexer\Lexer $Lexer will be injected on loading FIXME this should be done by setter */
14
    public $Lexer;
15
    protected $allowedModes = array();
16
17
    /** @inheritdoc */
18
    abstract public function getSort();
19
20
    /** @inheritdoc */
21
    public function preConnect()
22
    {
23
    }
24
25
    /** @inheritdoc */
26
    public function connectTo($mode)
27
    {
28
    }
29
30
    /** @inheritdoc */
31
    public function postConnect()
32
    {
33
    }
34
35
    /** @inheritdoc */
36
    public function accepts($mode)
37
    {
38
        return in_array($mode, (array) $this->allowedModes);
39
    }
40
}
41