BasicMutationResponse::__construct()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 3
ccs 2
cts 2
cp 1
rs 10
c 0
b 0
f 0
cc 1
eloc 1
nc 1
nop 0
crap 1
1
<?php declare(strict_types = 1);
2
3
namespace TomCizek\ResponseRecorder\Application\ResponseRecorder;
4
5
use TomCizek\ResponseRecorder\Application\ResponseRecorder\MutationResponse\DomainEventCollection;
6
use TomCizek\ResponseRecorder\Application\ResponseRecorder\MutationResponse\MutationErrorCollection;
7
8
final class BasicMutationResponse extends AbstractMutationResponse
9
{
10 9
	private function __construct()
11
	{
12 9
	}
13
14 9
	public static function create(
15
		DomainEventCollection $aggregateChangedEvents,
16
		MutationErrorCollection $errors
17
	): BasicMutationResponse {
18 9
		$instance = new self();
19 9
		$instance->domainEvents = $aggregateChangedEvents;
20 9
		$instance->errors = $errors;
21
22 9
		return $instance;
23
	}
24
}
25