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

TextRenderer   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 12
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
wmc 2
eloc 4
c 0
b 0
f 0
dl 0
loc 12
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A render() 0 7 2
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