Passed
Branch new-version (84e8bd)
by Jeroen
03:20
created

Note::getFormatter()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 3
Ratio 100 %

Importance

Changes 0
Metric Value
cc 1
eloc 1
nc 1
nop 0
dl 3
loc 3
rs 10
c 0
b 0
f 0
1
<?php
2
3
namespace JeroenDesloovere\VCard\Property;
4
5
use JeroenDesloovere\VCard\Formatter\Property\NoteFormatter;
6
use JeroenDesloovere\VCard\Formatter\Property\NodeFormatterInterface;
7
use JeroenDesloovere\VCard\Parser\Property\NodeParserInterface;
8
use JeroenDesloovere\VCard\Parser\Property\NoteParser;
9
10 View Code Duplication
final class Note implements PropertyInterface, SimpleNodeInterface
1 ignored issue
show
Duplication introduced by
This class seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
11
{
12
    /**
13
     * @var string
14
     */
15
    private $value;
16
17
    public function __construct(string $value)
18
    {
19
        $this->value = $value;
20
    }
21
22
    public function __toString(): string
23
    {
24
        return $this->value;
25
    }
26
27
    public function getFormatter(): NodeFormatterInterface
28
    {
29
        return new NoteFormatter($this);
30
    }
31
32
    public static function getNode(): string
33
    {
34
        return 'NOTE';
35
    }
36
37
    public static function getParser(): NodeParserInterface
38
    {
39
        return new NoteParser();
40
    }
41
42
    public function isAllowedMultipleTimes(): bool
43
    {
44
        return false;
45
    }
46
}
47