Test Setup Failed
Pull Request — latest (#3)
by Mark
32:07
created

TextRenderer::render()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 7
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
eloc 3
c 0
b 0
f 0
dl 0
loc 7
rs 10
cc 2
nc 2
nop 1
1
<?php
2
3
declare(strict_types=1);
4
5
/*
6
 * This file was originally part of the league/commonmark package.
7
 *
8
 * (c) Colin O'Dell <[email protected]>
9
 *
10
 * Original code based on the CommonMark JS reference parser (https://bitly.com/commonmark-js)
11
 *  - (c) John MacFarlane
12
 *
13
 * For the full copyright and license information, please view the LICENSE
14
 * file that was distributed with this source code.
15
 */
16
17
namespace UnicornFail\Emoji\Renderer;
18
19
use UnicornFail\Emoji\Node\Node;
20
use UnicornFail\Emoji\Node\Text;
21
22
final class TextRenderer implements NodeRendererInterface
23
{
24
    /**
25
     * {@inheritdoc}
26
     */
27
    public function render(Node $node)
28
    {
29
        if (! ($node instanceof Text)) {
30
            throw new \InvalidArgumentException('Incompatible node type: ' . \get_class($node));
31
        }
32
33
        return $node;
34
    }
35
}
36