ContactParser   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 18
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 1
Metric Value
wmc 1
eloc 15
c 1
b 0
f 1
dl 0
loc 18
ccs 15
cts 15
cp 1
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A parse() 0 16 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Swis\Melvin\Parsers;
6
7
use Swis\Melvin\Models\Contact;
8
9
class ContactParser
10
{
11 6
    public function parse(\stdClass $object): Contact
12
    {
13 6
        return new Contact(
14 6
            $object->contactId,
15 6
            $object->firstName,
16 6
            $object->prefix,
17 6
            $object->lastName,
18 6
            $object->email,
19 6
            $object->phone,
20 6
            $object->organisation ?? $object->organization,
21 6
            $object->parentSituationId,
22 6
            $object->function,
23 6
            $object->publicPhone,
24 6
            $object->active,
25 6
            $object->createdById,
26 6
            $object->changedById
27 3
        );
28
    }
29
}
30