OrganizerProjectedToJSONLD   A
last analyzed

Complexity

Total Complexity 5

Size/Duplication

Total Lines 41
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 0

Importance

Changes 0
Metric Value
wmc 5
lcom 1
cbo 0
dl 0
loc 41
rs 10
c 0
b 0
f 0

5 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 5 1
A getId() 0 4 1
A getIri() 0 4 1
A serialize() 0 7 1
A deserialize() 0 4 1
1
<?php
2
3
namespace CultuurNet\UDB3\Organizer;
4
5
use Broadway\Serializer\SerializableInterface;
6
7
class OrganizerProjectedToJSONLD implements SerializableInterface
8
{
9
    /**
10
     * @var string
11
     */
12
    private $id;
13
14
    /**
15
     * @var string
16
     */
17
    private $iri;
18
19
    public function __construct(string $id, string $iri)
20
    {
21
        $this->id = $id;
22
        $this->iri = $iri;
23
    }
24
25
    public function getId(): string
26
    {
27
        return $this->id;
28
    }
29
30
    public function getIri(): string
31
    {
32
        return $this->iri;
33
    }
34
35
    public function serialize(): array
36
    {
37
        return [
38
            'id' => $this->getId(),
39
            'iri' => $this->getIri(),
40
        ];
41
    }
42
43
    public static function deserialize(array $data): OrganizerProjectedToJSONLD
44
    {
45
        return new self($data['id'], $data['iri']);
46
    }
47
}
48