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   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 24
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 2

Test Coverage

Coverage 46.15%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 4
lcom 1
cbo 2
dl 0
loc 24
ccs 6
cts 13
cp 0.4615
rs 10
c 1
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A get() 0 10 3
A getName() 0 4 1
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