DomainEventNotUnderstandableException   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 22
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 1
lcom 0
cbo 0
dl 0
loc 22
ccs 3
cts 3
cp 1
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A fromAggreagteAndEventTypes() 0 12 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