Waiter::prepareDelivery()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 2
Bugs 2 Features 0
Metric Value
c 2
b 2
f 0
dl 0
loc 6
rs 9.4285
cc 1
eloc 3
nc 1
nop 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