Completed
Push — master ( b9f7b1...c05cbd )
by Ariel
09:22
created

BookingManager::confirm()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 1
Bugs 0 Features 1
Metric Value
c 1
b 0
f 1
dl 0
loc 4
ccs 2
cts 2
cp 1
rs 10
cc 1
eloc 2
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 annulate()
26
    {
27 1
        return $this->appointment->doAnnulate();
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