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

EventFactory   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 27
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 2

Importance

Changes 0
Metric Value
wmc 2
lcom 1
cbo 2
dl 0
loc 27
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A createEvent() 0 7 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