ModeInterface.php 822 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. <?php
  2. namespace dokuwiki\Parsing\ParserMode;
  3. /**
  4. * Defines a mode (syntax component) in the Parser
  5. */
  6. interface ModeInterface
  7. {
  8. /**
  9. * returns a number used to determine in which order modes are added
  10. *
  11. * @return int;
  12. */
  13. public function getSort();
  14. /**
  15. * Called before any calls to connectTo
  16. *
  17. * @return void
  18. */
  19. public function preConnect();
  20. /**
  21. * Connects the mode
  22. *
  23. * @param string $mode
  24. * @return void
  25. */
  26. public function connectTo($mode);
  27. /**
  28. * Called after all calls to connectTo
  29. *
  30. * @return void
  31. */
  32. public function postConnect();
  33. /**
  34. * Check if given mode is accepted inside this mode
  35. *
  36. * @param string $mode
  37. * @return bool
  38. */
  39. public function accepts($mode);
  40. }