Staff   A
last analyzed

Complexity

Total Complexity 5

Size/Duplication

Total Lines 37
Duplicated Lines 0 %

Importance

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

5 Methods

Rating   Name   Duplication   Size   Complexity  
A getPosition() 0 3 1
A getMembershipNumber() 0 3 1
A getId() 0 3 1
A createFromResponse() 0 10 1
A getName() 0 3 1
1
<?php
2
declare(strict_types=1);
3
4
namespace Eekes\VblApi\Entity;
5
6
class Staff
7
{
8
    private string $id;
9
    private string $name;
10
    private ?string $membershipNumber;
11
    private ?string $position;
12
13
    public static function createFromResponse(\stdClass $response): self
14
    {
15
        $staff = new self();
16
17
        $staff->id = $response->relGuid;
18
        $staff->name = $response->naam;
19
        $staff->membershipNumber = $response->lidNr;
20
        $staff->position = $response->tvCaC;
21
22
        return $staff;
23
    }
24
25
    public function getId(): string
26
    {
27
        return $this->id;
28
    }
29
30
    public function getName(): string
31
    {
32
        return $this->name;
33
    }
34
35
    public function getMembershipNumber(): ?string
36
    {
37
        return $this->membershipNumber;
38
    }
39
40
    public function getPosition(): ?string
41
    {
42
        return $this->position;
43
    }
44
}
45