Просмотр файла vendor/league/commonmark/src/InlineParserContext.php

Размер файла: 1.58Kb
  1. <?php
  2.  
  3. /*
  4. * This file is part of the league/commonmark package.
  5. *
  6. * (c) Colin O'Dell <colinodell@gmail.com>
  7. *
  8. * Original code based on the CommonMark JS reference parser (https://bitly.com/commonmark-js)
  9. * - (c) John MacFarlane
  10. *
  11. * For the full copyright and license information, please view the LICENSE
  12. * file that was distributed with this source code.
  13. */
  14.  
  15. namespace League\CommonMark;
  16.  
  17. use League\CommonMark\Block\Element\AbstractBlock;
  18. use League\CommonMark\Block\Element\AbstractStringContainerBlock;
  19. use League\CommonMark\Delimiter\DelimiterStack;
  20. use League\CommonMark\Reference\ReferenceMapInterface;
  21.  
  22. class InlineParserContext
  23. {
  24. /** @var AbstractStringContainerBlock */
  25. private $container;
  26. /** @var ReferenceMapInterface */
  27. private $referenceMap;
  28. /** @var Cursor */
  29. private $cursor;
  30. /** @var DelimiterStack */
  31. private $delimiterStack;
  32.  
  33. public function __construct(AbstractStringContainerBlock $container, ReferenceMapInterface $referenceMap)
  34. {
  35. $this->referenceMap = $referenceMap;
  36. $this->container = $container;
  37. $this->cursor = new Cursor(\trim($container->getStringContent()));
  38. $this->delimiterStack = new DelimiterStack();
  39. }
  40.  
  41. public function getContainer(): AbstractBlock
  42. {
  43. return $this->container;
  44. }
  45.  
  46. public function getReferenceMap(): ReferenceMapInterface
  47. {
  48. return $this->referenceMap;
  49. }
  50.  
  51. public function getCursor(): Cursor
  52. {
  53. return $this->cursor;
  54. }
  55.  
  56. public function getDelimiterStack(): DelimiterStack
  57. {
  58. return $this->delimiterStack;
  59. }
  60. }