You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

43 lines
867 B

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