BookingManager   A
last analyzed

Complexity

Total Complexity 5

Size/Duplication

Total Lines 33
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 5
lcom 1
cbo 1
dl 0
loc 33
ccs 12
cts 12
cp 1
rs 10
c 0
b 0
f 0

5 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A appointment() 0 6 1
A cancel() 0 4 1
A confirm() 0 4 1
A serve() 0 4 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