EntityNamingTrait   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 16
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 1
c 1
b 0
f 0
lcom 0
cbo 0
dl 0
loc 16
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A getApplyMethodName() 0 6 1
1
<?php
2
/*
3
 * This file is part of the Borobudur-Event-Sourcing package.
4
 *
5
 * (c) Hexacodelabs <http://hexacodelabs.com>
6
 *
7
 * For the full copyright and license information, please view the LICENSE
8
 * file that was distributed with this source code.
9
 */
10
11
namespace Borobudur\EventSourcing\Entity;
12
13
use Borobudur\Cqrs\Message\DomainEventInterface;
14
15
/**
16
 * @author      Iqbal Maulana <[email protected]>
17
 * @created     8/20/15
18
 */
19
trait EntityNamingTrait
20
{
21
    /**
22
     * Get method name for apply domain event.
23
     *
24
     * @param DomainEventInterface $event
25
     *
26
     * @return string
27
     */
28
    protected function getApplyMethodName(DomainEventInterface $event)
29
    {
30
        $parts = explode('\\', get_class($event));
31
32
        return 'apply' . end($parts);
33
    }
34
}
35