Passed
Branch new-version (5a237d)
by Jeroen
02:27
created

NameFormatter::convertToVcfString()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 2
nc 1
nop 1
dl 0
loc 4
rs 10
c 0
b 0
f 0
1
<?php
2
3
namespace JeroenDesloovere\VCard\Formatter\Property;
4
5
use JeroenDesloovere\VCard\Property\Name;
6
use JeroenDesloovere\VCard\Property\PropertyInterface;
7
use PHP_CodeSniffer\Exceptions\RuntimeException;
0 ignored issues
show
Bug introduced by
The type PHP_CodeSniffer\Exceptions\RuntimeException was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
8
9
class NameFormatter extends PropertyFormatter implements PropertyFormatterInterface
10
{
11
    /**
12
     * @var Name
13
     */
14
    protected $name;
15
16
    public function __construct(Name $name)
17
    {
18
        $this->name = $name;
19
    }
20
21
    public function getVcfString(): string
22
    {
23
        return $this->name->getNode() . ':' . $this->escape(
24
            $this->name->getFirstName() . ';' . $this->name->getAdditional() . ';' . $this->name->getLastName() . ';' . $this->name->getPrefix() . ';' . $this->name->getSuffix()
25
        );
26
    }
27
}
28