OpenAPI Generator. Better DocBlock parsing [WIP]
[dokuwiki.git] / inc / Parsing / ParserMode / AbstractMode.php
blob44dfe01039e671c1b51b1036c8696b943ea23c71
1 <?php
3 namespace dokuwiki\Parsing\ParserMode;
5 use dokuwiki\Parsing\Lexer\Lexer;
7 /**
8 * This class and all the subclasses below are used to reduce the effort required to register
9 * modes with the Lexer.
11 * @author Harry Fuecks <hfuecks@gmail.com>
13 abstract class AbstractMode implements ModeInterface
15 /** @var Lexer $Lexer will be injected on loading FIXME this should be done by setter */
16 public $Lexer;
17 protected $allowedModes = [];
19 /** @inheritdoc */
20 abstract public function getSort();
22 /** @inheritdoc */
23 public function preConnect()
27 /** @inheritdoc */
28 public function connectTo($mode)
32 /** @inheritdoc */
33 public function postConnect()
37 /** @inheritdoc */
38 public function accepts($mode)
40 return in_array($mode, (array) $this->allowedModes);