DrinkRouter   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 11
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A selectChannels() 0 8 2
1
<?php
2
3
use PEIP\ABS\Router\Router;
4
use PEIP\INF\Message\Message;
5
6
class DrinkRouter extends Router
7
{
8
    protected function selectChannels(Message $message)
9
    {
10
        $order = $message->getContent();
11
        $channelName = $order['iced']  ? 'coldDrinks' : 'hotDrinks';
12
        echo PEIP_LINE_SEPARATOR."DrinkRouter: routed to channel: $channelName";
13
14
        return $channelName;
15
    }
16
}
17