EmojiExporter   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 10
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 6
c 1
b 0
f 0
dl 0
loc 10
rs 10
wmc 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A export() 0 8 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace DH\Adf\Exporter\Html\Inline;
6
7
use DH\Adf\Exporter\Html\HtmlExporter;
8
use DH\Adf\Node\Inline\Emoji;
9
10
class EmojiExporter extends HtmlExporter
11
{
12
    public function export(): string
13
    {
14
        \assert($this->node instanceof Emoji);
15
16
        return sprintf(
17
            '<img class="adf-emoji" loading="lazy" src="https://pf-emoji-service--cdn.us-east-1.prod.public.atl-paas.net/standard/a51a7674-8d5d-4495-a2d2-a67c090f5c3b/64x64/%s.png" alt=":%s:" width="20" height="20">',
18
            $this->node->getId(),
0 ignored issues
show
Bug introduced by
The method getId() does not exist on DH\Adf\Node\Node. It seems like you code against a sub-type of DH\Adf\Node\Node such as DH\Adf\Node\Child\Media or DH\Adf\Node\Inline\Mention or DH\Adf\Node\Inline\Emoji or DH\Adf\Node\Mark\Link. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

18
            $this->node->/** @scrutinizer ignore-call */ 
19
                         getId(),
Loading history...
19
            $this->node->getShortName()
0 ignored issues
show
Bug introduced by
The method getShortName() does not exist on DH\Adf\Node\Node. It seems like you code against a sub-type of DH\Adf\Node\Node such as DH\Adf\Node\Inline\Emoji. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

19
            $this->node->/** @scrutinizer ignore-call */ 
20
                         getShortName()
Loading history...
20
        );
21
    }
22
}
23