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

TwemojiConverter::create()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 1
Metric Value
eloc 3
c 1
b 0
f 1
dl 0
loc 6
rs 10
cc 1
nc 1
nop 2
1
<?php
2
3
declare(strict_types=1);
4
5
namespace UnicornFail\Emoji;
6
7
use UnicornFail\Emoji\Environment\Environment;
8
use UnicornFail\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
    public static function create(array $config = [], bool $setAsDefaultConversionType = true): EmojiConverterInterface
18
    {
19
        $environment = Environment::create($config);
20
        $environment->addExtension(new TwemojiExtension($setAsDefaultConversionType));
21
22
        return new self($environment);
23
    }
24
}
25