TestAggregateRoot::create()   A
last analyzed

Complexity

Conditions 2
Paths 2

Size

Total Lines 8
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 8
rs 9.4285
c 0
b 0
f 0
cc 2
eloc 5
nc 2
nop 1
1
<?php declare(strict_types = 1);
2
3
namespace TomCizek\SymfonyProoph\Tests\EventSourcing\FakeImplementations;
4
5
use Prooph\EventSourcing\AggregateChanged;
6
use Prooph\EventSourcing\AggregateRoot;
7
use Ramsey\Uuid\Uuid;
8
use Ramsey\Uuid\UuidInterface;
9
10
class TestAggregateRoot extends AggregateRoot
11
{
12
	public static function create(UuidInterface $uuid = null)
13
	{
14
		$uuid = $uuid ?: Uuid::uuid4();
15
		$instance = new self();
16
		$instance->recordThat(TestAggregateCreated::create($uuid));
17
18
		return $instance;
19
	}
20
21
	protected function aggregateId(): string
22
	{
23
		return 'fake';
24
	}
25
26
	protected function apply(AggregateChanged $event): void
27
	{
28
	}
29
}
30