TwemojiConverter::create()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 4
CRAP Score 1

Importance

Changes 0
Metric Value
cc 1
eloc 3
nc 1
nop 2
dl 0
loc 6
ccs 4
cts 4
cp 1
crap 1
rs 10
c 0
b 0
f 0
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