UserMessageNaming   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 12
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

Changes 0
Metric Value
wmc 1
lcom 0
cbo 0
dl 0
loc 12
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A generateMessageNameFromClassName() 0 6 1
1
<?php
2
3
declare (strict_types = 1);
4
5
namespace HMLB\UserBundle\Message;
6
7
/**
8
 * Trait UserMessageNaming.
9
 *
10
 * @author Hugues Maignol <[email protected]>
11
 */
12
trait UserMessageNaming
13
{
14
    /**
15
     * @return string
16
     */
17
    protected static function generateMessageNameFromClassName(): string
18
    {
19
        $slices = explode('\\', get_called_class());
20
21
        return 'hmlb_user_'.strtolower(preg_replace('/([^A-Z])([A-Z])/', '$1_$2', end($slices)));
22
    }
23
}
24