OrganizerProjectedToJSONLD::deserialize()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 4
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 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