BookingManager::cancel()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 4
ccs 2
cts 2
cp 1
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 0
crap 1
1
<?php
2
3
namespace Timegridio\Concierge\Booking;
4
5
use Timegridio\Concierge\Models\Business;
6
7
class BookingManager
8
{
9
    protected $business;
10
11
    protected $appointment;
12
13 3
    public function __construct(Business $business)
14
    {
15 3
        $this->business = $business;
16 3
    }
17
18 3
    public function appointment($hash)
19
    {
20 3
        $this->appointment = $this->business->bookings()->where('hash', 'like', $hash.'%')->get()->first();
21
22 3
        return $this;
23
    }
24
25 1
    public function cancel()
26
    {
27 1
        return $this->appointment->doCancel();
28
    }
29
30 1
    public function confirm()
31
    {
32 1
        return $this->appointment->doConfirm();
33
    }
34
35 1
    public function serve()
36
    {
37 1
        return $this->appointment->doServe();
38
    }
39
}
40