NoContentTagToString   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 44
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
eloc 15
dl 0
loc 44
ccs 20
cts 20
cp 1
rs 10
c 0
b 0
f 0
wmc 4

4 Methods

Rating   Name   Duplication   Size   Complexity  
A getRemovedDescription() 0 9 1
A getAddedDescription() 0 9 1
A getChangedTo() 0 3 1
A getChangedFrom() 0 3 1
1
<?php
2
/**
3
 * (c) Steve Nebes <[email protected]>
4
 *
5
 * For the full copyright and license information, please view the LICENSE
6
 * file that was distributed with this source code.
7
 */
8
9
declare(strict_types=1);
10
11
namespace SN\DaisyDiff\Html\Ancestor\TagToString;
12
13
use SN\DaisyDiff\Html\ChangeText;
14
15
/**
16
 * Image <img> tag to string.
17
 */
18
class NoContentTagToString extends TagToString
19
{
20
    /**
21
     * @param ChangeText $text
22
     */
23 1
    public function getAddedDescription(ChangeText $text): void
24
    {
25 1
        $text->characters(\sprintf('%s %s ', $this->getChangedTo(), \mb_strtolower($this->getArticle())));
26 1
        $text->startElement('b');
27 1
        $text->characters(\mb_strtolower($this->getDescription()));
28 1
        $text->endElement('b');
29
30 1
        $this->addAttributes($text, $this->node->getAttributes());
31 1
        $text->characters('.');
32 1
    }
33
34
    /**
35
     * @return string
36
     */
37 1
    private function getChangedTo(): string
38
    {
39 1
        return $this->getString('diff-changedto');
40
    }
41
42
    /**
43
     * @param ChangeText $text
44
     */
45 1
    public function getRemovedDescription(ChangeText $text): void
46
    {
47 1
        $text->characters(\sprintf('%s %s ', $this->getChangedFrom(), \mb_strtolower($this->getArticle())));
48 1
        $text->startElement('b');
49 1
        $text->characters(\mb_strtolower($this->getDescription()));
50 1
        $text->endElement('b');
51
52 1
        $this->addAttributes($text, $this->node->getAttributes());
53 1
        $text->characters('.');
54 1
    }
55
56
    /**
57
     * @return string
58
     */
59 1
    private function getChangedFrom(): string
60
    {
61 1
        return $this->getString('diff-changedto');
62
    }
63
}
64