Passed
Branch 2.0.0-dev (13f4c3)
by Jeroen
03:42
created

Url   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 20
Duplicated Lines 0 %

Importance

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

4 Methods

Rating   Name   Duplication   Size   Complexity  
A getFormatter() 0 3 1
A isAllowedMultipleTimes() 0 3 1
A getParser() 0 3 1
A getNode() 0 3 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace JeroenDesloovere\VCard\Property;
6
7
use JeroenDesloovere\VCard\Formatter\Property\NodeFormatterInterface;
8
use JeroenDesloovere\VCard\Formatter\Property\UrlFormatter;
9
use JeroenDesloovere\VCard\Parser\Property\NodeParserInterface;
10
use JeroenDesloovere\VCard\Parser\Property\UrlParser;
11
use JeroenDesloovere\VCard\Property\Value\StringValue;
12
13
final class Url extends StringValue implements PropertyInterface, SimpleNodeInterface
14
{
15
    public function getFormatter(): NodeFormatterInterface
16
    {
17
        return new UrlFormatter($this);
18
    }
19
20
    public static function getNode(): string
21
    {
22
        return 'URL';
23
    }
24
25
    public static function getParser(): NodeParserInterface
26
    {
27
        return new UrlParser();
28
    }
29
30
    public function isAllowedMultipleTimes(): bool
31
    {
32
        return false;
33
    }
34
}
35