GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.

HasName::getName()   A
last analyzed

Complexity

Conditions 2
Paths 2

Size

Total Lines 10

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 6

Importance

Changes 0
Metric Value
dl 0
loc 10
ccs 0
cts 8
cp 0
rs 9.9332
c 0
b 0
f 0
cc 2
nc 2
nop 0
crap 6
1
<?php
2
3
namespace Bernard\Message;
4
5
/**
6
 * Apply this trait to your message when you want it to follow the default message naming pattern.
7
 */
8
trait HasName
9
{
10
    /**
11
     * {@inheritdoc}
12
     */
13
    public function getName()
14
    {
15
        $class = get_class($this);
16
17
        if (substr($class, -7) == 'Message') {
18
            $class = substr($class, 0, -7);
19
        }
20
21
        return current(array_reverse(explode('\\', $class)));
22
    }
23
}
24