Passed
Push — master ( 118848...a2adfc )
by Adam
05:55
created

ReservationTableService   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 43
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
dl 0
loc 43
ccs 24
cts 24
cp 1
rs 10
c 0
b 0
f 0
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A getRouteName() 0 3 1
B getColumns() 0 36 1
1
<?php
2
3
namespace App\Services;
4
5
use App\Models\Reservation;
6
7
class ReservationTableService implements TableServiceInterface
8
{
9 3
    public function getRouteName()
10
    {
11 3
        return 'reservation';
12
    }
13
14 3
    public function getColumns()
15
    {
16
        $dataset = [
17
            [
18 3
                'title' => trans('general.room'),
19 3
                'value' => function (Reservation $data) {
20 1
                    return $data->room->number;
21 3
                },
22
            ],
23
            [
24 3
                'title' => trans('general.guest'),
25 3
                'value' => function (Reservation $data) {
26 1
                    return $data->guest->full_name;
27 3
                },
28
            ],
29
            [
30 3
                'title' => trans('general.date_start'),
31 3
                'value' => function (Reservation $data) {
32 1
                    return $data->date_start;
33 3
                },
34
            ],
35
            [
36 3
                'title' => trans('general.date_end'),
37 3
                'value' => function (Reservation $data) {
38 1
                    return $data->date_end;
39 3
                },
40
            ],
41
            [
42 3
                'title' => trans('general.number_of_people'),
43 3
                'value' => function (Reservation $data) {
44 1
                    return $data->people;
45 3
                },
46
            ],
47
        ];
48
49 3
        return $dataset;
50
    }
51
}
52