fromAggreagteAndEventTypes()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 12

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 3
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 12
ccs 3
cts 3
cp 1
rs 9.8666
c 0
b 0
f 0
cc 1
nc 1
nop 4
crap 1
1
<?php
2
3
namespace DDDominio\EventSourcing\Common;
4
5
class DomainEventNotUnderstandableException extends \Exception
6
{
7
    /**
8
     * @param string $aggregateType
9
     * @param string $eventType
10
     * @param int $code
11
     * @param \Exception|null $previous
12
     * @return DomainEventNotUnderstandableException
13
     */
14 1
    public static function fromAggreagteAndEventTypes($aggregateType, $eventType, $code = 0, \Exception $previous = null)
15
    {
16 1
        return new self(
17
            sprintf(
18 1
                'The aggregate of type %s does not understand events of type %s',
19
                $aggregateType,
20
                $eventType
21
            ),
22
            $code,
23
            $previous
24
        );
25
    }
26
}
27