Passed
Push — main ( 16e3d2...2668c7 )
by Damien
07:42
created

MentionExporter::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 2
c 1
b 0
f 0
nc 1
nop 1
dl 0
loc 4
rs 10
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\Mention;
9
10
class MentionExporter extends HtmlExporter
11
{
12
    public function __construct(Mention $node)
13
    {
14
        parent::__construct($node);
15
        $this->tags = ['<span class="adf-mention">', '</span>'];
16
    }
17
18
    public function export(): string
19
    {
20
        \assert($this->node instanceof Mention);
21
22
        return $this->tags[0].$this->node->getText().$this->tags[1];
0 ignored issues
show
Bug introduced by
The method getText() 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\Status or DH\Adf\Node\Inline\Mention or DH\Adf\Node\Inline\Text or 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

22
        return $this->tags[0].$this->node->/** @scrutinizer ignore-call */ getText().$this->tags[1];
Loading history...
23
    }
24
}
25