ContactParser::parse()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 16
Code Lines 14

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 15
CRAP Score 1

Importance

Changes 1
Bugs 0 Features 1
Metric Value
eloc 14
c 1
b 0
f 1
dl 0
loc 16
ccs 15
cts 15
cp 1
rs 9.7998
cc 1
nc 1
nop 1
crap 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