TwemojiConverter   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 13
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
eloc 5
dl 0
loc 13
ccs 4
cts 4
cp 1
rs 10
c 0
b 0
f 0
wmc 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A create() 0 6 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace League\Emoji;
6
7
use League\Emoji\Environment\Environment;
8
use League\Emoji\Extension\Twemoji\TwemojiExtension;
9
10
final class TwemojiConverter extends EmojiConverter
11
{
12
    public const CONVERSION_TYPE = TwemojiExtension::CONVERSION_TYPE;
13
14
    /**
15
     * @param array<string, mixed> $config
16
     */
17 18
    public static function create(array $config = [], bool $setAsDefaultConversionType = true): EmojiConverterInterface
18
    {
19 18
        $environment = Environment::create($config);
20 18
        $environment->addExtension(new TwemojiExtension($setAsDefaultConversionType));
21
22 18
        return new self($environment);
23
    }
24
}
25