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.
Completed
Push — master ( cb8968...43f345 )
by Márk
03:35
created

ClassNameRouter::map()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 10
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 5
CRAP Score 2.2109

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 10
ccs 5
cts 8
cp 0.625
rs 9.4285
cc 2
eloc 5
nc 2
nop 1
crap 2.2109
1
<?php
2
3
namespace Bernard\Router;
4
5
use Bernard\Envelope;
6
7
/**
8
 * Uses the message class name as the message name.
9
 * Allows registering catch-all receivers for message parent types.
10
 */
11
final class ClassNameRouter extends ReceiverMapRouter
12
{
13
    /**
14
     * {@inheritdoc}
15
     */
16 3
    protected function get($name)
17
    {
18 3
        foreach ($this->receivers as $key => $receiver) {
19 3
            if (is_a($name, $key, true)) {
20 3
                return $receiver;
21
            }
22
        }
23
24
        return null;
25
    }
26
27
    /**
28
     * {@inheritdoc}
29
     */
30 3
    protected function getName(Envelope $envelope)
31
    {
32 3
        return $envelope->getClass();
33
    }
34
}
35