Passed
Push — master ( 134841...7712b0 )
by Mr
02:17
created

AnnotatedCommand   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 13
Duplicated Lines 0 %

Test Coverage

Coverage 50%

Importance

Changes 0
Metric Value
eloc 5
c 0
b 0
f 0
dl 0
loc 13
rs 10
ccs 2
cts 4
cp 0.5
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A hasKnownAggregateRevision() 0 3 1
A getKnownAggregateRevision() 0 3 1
1
<?php declare(strict_types=1);
2
/**
3
 * This file is part of the daikon-cqrs/event-sourcing project.
4
 *
5
 * For the full copyright and license information, please view the LICENSE
6
 * file that was distributed with this source code.
7
 */
8
9
namespace Daikon\EventSourcing\Aggregate\Command;
10
11
use Daikon\EventSourcing\Aggregate\AggregateAnnotated;
12
use Daikon\EventSourcing\Aggregate\AggregateRevision;
13
use Daikon\Interop\FromToNativeTrait;
14
15
trait AnnotatedCommand
16
{
17
    use AggregateAnnotated;
18
    use FromToNativeTrait;
19
20 1
    public function getKnownAggregateRevision(): AggregateRevision
21
    {
22 1
        return $this->{static::getAnnotatedRevision()};
23
    }
24
25
    public function hasKnownAggregateRevision(): bool
26
    {
27
        return !$this->getKnownAggregateRevision()->isEmpty();
28
    }
29
}
30