Passed
Push — master ( dbf047...1b561f )
by Daniel
02:26
created

EventFactory::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
eloc 1
c 0
b 0
f 0
dl 0
loc 3
rs 10
cc 1
nc 1
nop 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Jellyfish\Event;
6
7
use Jellyfish\Uuid\UuidGeneratorInterface;
8
9
class EventFactory implements EventFactoryInterface
10
{
11
    /**
12
     * @var \Jellyfish\Uuid\UuidGeneratorInterface
13
     */
14
    protected $uuidGenerator;
15
16
    /**
17
     * @param \Jellyfish\Uuid\UuidGeneratorInterface $uuidGenerator
18
     */
19
    public function __construct(UuidGeneratorInterface $uuidGenerator)
20
    {
21
        $this->uuidGenerator = $uuidGenerator;
22
    }
23
24
    /**
25
     * @return \Jellyfish\Event\EventInterface
26
     */
27
    public function create(): EventInterface
28
    {
29
        return new Event($this->uuidGenerator->generate());
30
    }
31
}
32