Completed
Push — master ( b87198...f2f319 )
by Frank
02:38
created

EventApplyingBehaviour::apply()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 4
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 5
c 0
b 0
f 0
ccs 4
cts 4
cp 1
rs 9.4285
cc 1
eloc 3
nc 1
nop 1
crap 1
1
<?php
2
3
namespace EventSauce\EventSourcing\AggregateRootBehaviour;
4
5
use EventSauce\EventSourcing\Event;
6
7
trait EventApplyingBehaviour
8
{
9 3
    protected function apply(Event $event)
10
    {
11 3
        $parts = explode('\\', get_class($event));
12 3
        $this->{'apply' . end($parts)}($event);
13
    }
14
}