| Total Complexity | 4 |
| Total Lines | 40 |
| Duplicated Lines | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 1 |
| 1 | <?php |
||
| 14 | class EmojiConverter implements EmojiConverterInterface |
||
| 15 | { |
||
| 16 | /** @var EnvironmentInterface */ |
||
| 17 | private $environment; |
||
| 18 | |||
| 19 | /** @var EmojiParserInterface */ |
||
| 20 | private $parser; |
||
| 21 | |||
| 22 | /** @var EmojiRendererInterface */ |
||
| 23 | private $renderer; |
||
| 24 | |||
| 25 | public function __construct(EnvironmentInterface $environment) |
||
| 26 | { |
||
| 27 | $this->environment = $environment; |
||
| 28 | $this->parser = new EmojiParser($environment); |
||
| 29 | $this->renderer = new EmojiRenderer($environment); |
||
| 30 | } |
||
| 31 | |||
| 32 | /** |
||
| 33 | * Converts all HTML entities, shortcodes or emoticons to emojis (unicode). |
||
| 34 | * |
||
| 35 | * @see EmojiConverterInterface::convert |
||
| 36 | * |
||
| 37 | * @throws \RuntimeException |
||
| 38 | */ |
||
| 39 | public function __invoke(string $input): RenderedContentInterface |
||
| 40 | { |
||
| 41 | return $this->convert($input); |
||
| 42 | } |
||
| 43 | |||
| 44 | public function convert(string $input): RenderedContentInterface |
||
| 49 | } |
||
| 50 | |||
| 51 | public function getEnvironment(): EnvironmentInterface |
||
| 54 | } |
||
| 55 | } |
||
| 56 |