Waiter   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 22
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 2

Importance

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

3 Methods

Rating   Name   Duplication   Size   Complexity  
A prepareDelivery() 0 6 1
A receiveOrder() 0 5 1
A getOrder() 0 4 1
1
<?php
2
3
4
class Waiter
5
{
6
    protected $orders;
7
8
    public function prepareDelivery(array $drinks)
9
    {
10
        echo PEIP_LINE_SEPARATOR.'Waiter: prepareDelivery: #'.$drinks[0]->getOrderNumber();
11
12
        return new Delivery($drinks);
13
    }
14
15
    public function receiveOrder(Order $order)
16
    {
17
        echo PEIP_LINE_SEPARATOR.'Waiter: receiveOrder';
18
        $this->orders[$order->getOrderNumber()] = $order;
19
    }
20
21
    public function getOrder($nr)
22
    {
23
        return $this->orders[$nr];
24
    }
25
}
26