Passed
Push — master ( ca3291...6392a2 )
by Jasper
02:29
created

ContactParser::parse()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 15
Code Lines 13

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 14
CRAP Score 1

Importance

Changes 1
Bugs 0 Features 1
Metric Value
eloc 13
c 1
b 0
f 1
dl 0
loc 15
ccs 14
cts 14
cp 1
rs 9.8333
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 3
        );
27
    }
28
}
29