Completed
Push — master ( 9f147e...c59a3d )
by Kristof
05:32
created

EventFactory::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 4
rs 10
c 0
b 0
f 0
cc 1
eloc 2
nc 1
nop 1
1
<?php
2
3
namespace CultuurNet\UDB3\Organizer\ReadModel\JSONLD;
4
5
use CultuurNet\UDB3\Iri\IriGeneratorInterface;
6
use CultuurNet\UDB3\Organizer\OrganizerProjectedToJSONLD;
7
use CultuurNet\UDB3\ReadModel\DocumentEventFactory;
8
9
class EventFactory implements DocumentEventFactory
10
{
11
    /**
12
     * @var IriGeneratorInterface
13
     */
14
    private $iriGenerator;
15
16
    /**
17
     * @param IriGeneratorInterface $iriGenerator
18
     */
19
    public function __construct(IriGeneratorInterface $iriGenerator)
20
    {
21
        $this->iriGenerator = $iriGenerator;
22
    }
23
24
    /**
25
     * @param string $id
26
     * @return OrganizerProjectedToJSONLD
27
     */
28
    public function createEvent($id)
29
    {
30
        return new OrganizerProjectedToJSONLD(
31
            $id,
32
            $this->iriGenerator->iri($id)
33
        );
34
    }
35
}
36