Passed
Branch 2.0.0-dev (2fd06c)
by Jeroen
02:36
created

Telephone::getValue()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 1
nc 1
nop 0
dl 0
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\NodeFormatterInterface;
6
use JeroenDesloovere\VCard\Formatter\Property\LogoFormatter;
7
use JeroenDesloovere\VCard\Formatter\Property\TelephoneFormatter;
8
use JeroenDesloovere\VCard\Parser\Property\NodeParserInterface;
9
use JeroenDesloovere\VCard\Parser\Property\LogoParser;
10
use JeroenDesloovere\VCard\Parser\Property\TelephoneParser;
11
use JeroenDesloovere\VCard\Property\Value\ImageValue;
12
13
final class Telephone implements PropertyInterface, NodeInterface
14
{
15
    /** @var string */
16
    protected $value;
17
18
    public function __construct(string $value)
19
    {
20
        $this->value = str_replace(' ', '-', $value);
21
    }
22
23
    public function __toString(): string
24
    {
25
        return $this->value;
26
    }
27
28
    public function getFormatter(): NodeFormatterInterface
29
    {
30
        return new TelephoneFormatter($this);
31
    }
32
33
    public static function getNode(): string
34
    {
35
        return 'TEL';
36
    }
37
38
    public function getValue(): string
39
    {
40
        return $this->value;
41
    }
42
43
    public static function getParser(): NodeParserInterface
44
    {
45
        return new TelephoneParser();
46
    }
47
48
    public function isAllowedMultipleTimes(): bool
49
    {
50
        return false;
51
    }
52
}
53