FakeDelimiterProcessor.php 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. <?php
  2. declare(strict_types=1);
  3. /*
  4. * This file is part of the league/commonmark package.
  5. *
  6. * (c) Colin O'Dell <colinodell@gmail.com>
  7. *
  8. * Additional emphasis processing code based on commonmark-java (https://github.com/atlassian/commonmark-java)
  9. * - (c) Atlassian Pty Ltd
  10. *
  11. * For the full copyright and license information, please view the LICENSE
  12. * file that was distributed with this source code.
  13. */
  14. namespace League\CommonMark\Tests\Functional\Delimiter;
  15. use League\CommonMark\Delimiter\DelimiterInterface;
  16. use League\CommonMark\Delimiter\Processor\DelimiterProcessorInterface;
  17. use League\CommonMark\Node\Inline\AbstractStringContainer;
  18. final class FakeDelimiterProcessor implements DelimiterProcessorInterface
  19. {
  20. private string $delimiterChar;
  21. private int $delimiterUse;
  22. public function __construct(string $delimiterChar, int $delimiterUse)
  23. {
  24. $this->delimiterChar = $delimiterChar;
  25. $this->delimiterUse = $delimiterUse;
  26. }
  27. public function getOpeningCharacter(): string
  28. {
  29. return $this->delimiterChar;
  30. }
  31. public function getClosingCharacter(): string
  32. {
  33. return $this->delimiterChar;
  34. }
  35. public function getMinLength(): int
  36. {
  37. return 1;
  38. }
  39. public function getDelimiterUse(DelimiterInterface $opener, DelimiterInterface $closer): int
  40. {
  41. return $this->delimiterUse;
  42. }
  43. public function process(AbstractStringContainer $opener, AbstractStringContainer $closer, int $delimiterUse): void
  44. {
  45. }
  46. }