| 1 | <?php |
||
| 20 | class Transformer implements RendererInterface, ParserInterface |
||
| 21 | { |
||
| 22 | /** |
||
| 23 | * @var RendererInterface |
||
| 24 | */ |
||
| 25 | private $renderer; |
||
| 26 | |||
| 27 | /** |
||
| 28 | * @var ParserInterface |
||
| 29 | */ |
||
| 30 | private $parser; |
||
| 31 | |||
| 32 | /** |
||
| 33 | * Transformer constructor. |
||
| 34 | * @param RendererInterface $renderer |
||
| 35 | * @param ParserInterface $parser |
||
| 36 | */ |
||
| 37 | public function __construct(RendererInterface $renderer, ParserInterface $parser) |
||
| 42 | |||
| 43 | /** |
||
| 44 | * @param string $html |
||
| 45 | * @param array|UserInterface[] $mentions |
||
| 46 | * @return NodeList|NodeInterface[] |
||
| 47 | */ |
||
| 48 | public function parse(string $html, array $mentions): NodeList |
||
| 52 | |||
| 53 | /** |
||
| 54 | * @param NodeList $nodes |
||
| 55 | * @return string |
||
| 56 | */ |
||
| 57 | public function render(NodeList $nodes): string |
||
| 61 | |||
| 62 | } |
||
| 63 |